Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
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.