Discussions
Here are some examples to get your creative juices flowing.
"Did I pay vendor John Doe last month?"
"Take me to my largest sales order for this month."
"What invoices haven't been paid yet?"
nlapiRequestURL PDF download - Unexpected error
Hi,
I am trying to download 2 PDF files from RESTLet code - both from different hosts/urls. Once succeeds, the other fails with an "unexpected error" when nlapiReuqestURL is called.
The calling code is the same, just the URL differs:
// Setting up Headers
var headers = new Array();
headers['Accept'] = 'application/json'; // must be json (null or pdf returns "not acceptable" from the server side)
headers['Content-Type'] = 'application/json';
headers['Authorization'] = 'Bearer ' + access_token;
headers['client_id'] = client_id;
// Submit Request - Throws "Unexpected Error"
var response = nlapiRequestURL( encodeURI(myURL), null, headers );
NOTE: The token code works fine for simple API endpoints that return JSON. It;s only when I ask for a PDF file that it filas so it's not that.