0
votes

I am having issue in uploading file to box Via NetSUite Suitelet. I am able to connect through Postman. But I am not able to connect through NetSuite Suitelet. The call doesn't reach to Box at all. Can someone please assist?

1
Can you provide an example of the code you are trying?w3bguy
var headers = {'Authorization': "Bearer " + 'hjhjhjhjhjjj'}; var url = "upload.box.com/api/2.0/files/content"; var f = nlapiLoadFile('test/Capture001.png'); var parent = { 'id': '123' }; var attribs = { 'name' : 'Capture001.png', 'parent' : parent }; var body = { 'attributes' : attribs, 'file' : f.getName() }; nlapiLogExecution('DEBUG', 'Json', JSON.stringify(body)); var resp = nlapiRequestURL(url, JSON.stringify(body), headers, 'POST'); Response is blank ThanksNick

1 Answers

1
votes

The only thing I see an issue with, on the NetSuite side, is that you are missing a value in the call. Where I still use that 1.0 function I call it like this:

nlapiRequestURL(url,JSON.stringify(body),headers,null,'POST');

The API calls for the following parameters:

nlapiRequestURL(url, postdata, headers, callback, httpMethod)