Nour Khaled
01/27/2025, 8:49 PMCeligo AI
01/27/2025, 8:49 PMAI generated answer (using internal Slack threads):To change the authorization to OAuth 2.0 in SuiteScript 2.0, you would need to modify the headers in your request. Instead of using a bearer token, you would use the OAuth 2.0 token. Here's an example of how the headers might look:
javascript
var reqInformaHeaders = {
"Content-Type": "application/json",
Authorization: "OAuth " + token,
};
The rest of your request would remain the same:
javascript
var informaRes = <http://https.post|https.post>({
url: "<https://5729924-sb1.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=537&deploy=1>",
body: JSON.stringify(reqInformaBody),
headers: reqInformaHeaders,
});
Please note that the token used in the Authorization header should be the OAuth 2.0 token obtained from the OAuth 2.0 authorization server.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
01/27/2025, 8:50 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859245121
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.857895
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856846273
Celigo AI
01/27/2025, 8:50 PM