RE: How to pass parameters into RESTlet using POSTMAN ?
I created a RESTlet that creates a customer record by taking two parameters as argument(customer_name & subsidiary). I want to call the RESTlet from POSTMAN. I want to know , how to pass the parameter which are required to run the RESTlet. You can refer the code to understand the requirement:
function RestletPost(data)
{
//create customer record
var customer = nlapiCreateRecord(‘customer’);
//set values of the record depending on the values submitted to the Restlet
if (data.isperson == false)
{
customer.setFieldValue(‘isperson’, ‘F’);
}
else
{
customer.setFieldValue(‘isperson’, ‘T’);
}
customer.setFieldValue(‘companyname’, data.companyname);
customer.setFieldValue(‘subsidiary’, data.subsidiary);
customer.setFieldValue(‘billpay’, ‘F’);
//submit record to NetSuite
var id = nlapiSubmitRecord(customer);
//create an object that would contain the response to be sent
var output = new Object();
output.id = id;
//send response back
return output;
}
Depending to the HTTP method that you use. If it is in GET, you have to append that mentioned parameter into the URL. If POST, depends on the Context-Type, but I would suggest that you use JSON so that you could just post the parameters as JSON on the request body