So I’m a complete novice at this integration stuff...
# integrations
j
So I’m a complete novice at this integration stuff, so bear with me. I am testing setting up an integration on my sandbox. I am using the web version of Postman, which is also new to me. I have successfully followed a tutorial to set up an Integration record in NetSuite (on sandbox) and get Client Credentials (Machine to Machine) Grant working. After setting up the keys I can get back a bearer token, and I can use that to do a GET call to a RESTlet on my sandbox from Postman. However, when I try to do POST I get ‘An unexpected error has occurred.’ If I try just an https.post from my prod (calling the SB RESTlet with the same authentication token) it works fine, so I think the issue is to do with Postman, but I’m not sure what I need to set up differently in the POST request vs GET request in Postman.
Basically, my question boils down to how to do the equivalent of the following call from POSTman:
Copy code
var response = <http://https.post|https.post>({
			headers: {
				'Authorization': 'Bearer <my_token>',
				'content-type': 'application/json'
			},
			body: 'this is the body of the request',
			url: 'https://<account_id>-<http://sb4.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=1996&deploy=1|sb4.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=1996&deploy=1>'
		});
b
probably start at something more simple
so just send a request with only the authorization header set
ignore the content-type header and request body, those are more problems with your restlet code
j
actually it’s the OPPOSITE of what you said
In Postman I wasn’t sending a body at all
when I did, it started working