Nour Khaled
01/27/2025, 9:01 PMCeligo AI
01/27/2025, 9:01 PMAI generated answer (using internal Slack threads):In SuiteScript 2.0, you can add the integration credentials client token and client secret for the authorization in the headers of your HTTPS POST request. Here's a basic example of how you can do this:
javascript
var headers = {
'Authorization': 'Basic ' + encode.convert({
string: 'client_id:client_secret',
inputEncoding: encode.Encoding.UTF_8,
outputEncoding: encode.Encoding.BASE_64
})
};
var response = <http://https.post|https.post>({
url: '<https://your-url.com>',
headers: headers,
body: 'your_body'
});
In this example, replace 'client_id:client_secret' with your actual client id and client secret, separated by a colon. The 'Authorization' header is set to 'Basic ' followed by the Base64-encoded client id and client secret. The 'https.post' function is then used to send the HTTPS POST request.
Please note that you need to include the 'N/https' and 'N/encode' modules at the beginning of your script:
javascript
var https = require('N/https');
var encode = require('N/encode');
******
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, 9:01 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834059715
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833652318
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832684755
Celigo AI
01/27/2025, 9:01 PM