Can anyone point me in the direction of a good ref...
# suitescript
c
Can anyone point me in the direction of a good reference for making HTTPS calls to a non-NS REST interface from SS SuiteScript? Preferably SS2 but SS1 would be interesting too.
n
SS2: var a = {"User-Agent-x": "SuiteScript-Call"}; var response = nlapiRequestURL('https://www.myapi.com', null, a, null); var responsebody = JSON.parse(response.getBody()); SS1: var a = {"User-Agent-x": "SuiteScript-Call"}; var response = http.get({ url: 'https://www.myapi.com', headers: a }); var responsebody = JSON.parse(response.getBody()); If you have authorization headers, you'll want to generate and add them .
For better examples and documentation refer SS2.0 documentation : https://docs.oracle.com/cloud/latest/netsuitecs_gs/NSSDR/NSSDR.pdf Look for https.get & https.post
c
Thank you