HTTPS Methods for Secure Communication Between SuiteScript Scripts and REST Endpoints
SuiteScript scripts, RESTlets, and SuiteTalk REST endpoints share authentication from an existing session. The N/https methods let you skip reauthentication:
-
https.requestRestlet(options) - This method sends an https request to a RESTlet and returns the response. Authentication headers are automatically added. The RESTlet endpoint identified by its script ID is passed as a parameter. The RESTlet will run with the same privileges as the calling script.
-
https.requestSuiteTalkRest(options) - This method sends an https request to a SuiteTalk REST endpoint and returns the response. Authentication headers are automatically added. The REST endpoint identified by its URL is passed as a parameter.
You can use this method to pass information between SuiteScripts, RESTlets, or REST APIs. You no longer have to make a Suitelet available without login or set it to execute as Administrator.
These methods are for calling RESTlets within NetSuite only, not from outside applications.