what if i want to change the authorization to o au...
# ask-stanley-ai
n
what if i want to change the authorization to o auth 1 not a bearer in suitescript 2 var reqInformaHeaders = { "Content-Type": "application/json", Authorization: "Bearer " + token, }; var informaRes = https.post({ url: "https://5729924-sb1.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=537&deploy=1", body: JSON.stringify(reqInformaBody), headers: reqHeaders, });
c
AI generated answer (using internal Slack threads):
In order to change the authorization to OAuth 1.0 instead of a bearer token in SuiteScript 2.0, you would need to modify the headers in your HTTP request. Instead of using the "Bearer" keyword followed by the token, you would use the "OAuth" keyword followed by the OAuth 1.0 credentials. Here is an example of how you might modify your code:
Copy code
javascript
var reqInformaHeaders = {
    "Content-Type": "application/json",
    Authorization: "OAuth " + oauthCredentials,
};

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,
});
In this example,
oauthCredentials
would be a string containing your OAuth 1.0 credentials. Please note that the format of these credentials may vary depending on the specific requirements of the service you are interacting with. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841765463
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841202497
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841094375
Please provide your feedback on this answer.