erictgrubaugh
01/17/2019, 6:49 PMN/https
page:
// Request to an existing suitelet with credentials
var passwordGuid = option.request.parameters.password;
//Replace SCRIPTID and DEPLOYMENTID with the internal ID of the suitelet script and deployment in your account
var baseUrl = url.resolveScript({scriptID:SCRIPTID,deploymentId:DEPLOYMENTID,returnExternalURL:true});
var authUrl = baseUrl + '&pwd={' + passwordGuid + '}';
var secureStringUrl = https.createSecureString({
input: authUrl
});
var secureStringPWD = https.createSecureString({
input: '{' + passwordGuid + '}'
});
var headers = {
'pwd': secureStringPWD
};
var response = https.get({
credentials: [passwordGuid],
url: secureStringUrl,
headers: headers
});
zach_calh
01/17/2019, 9:01 PMzach_calh
01/17/2019, 9:01 PMerictgrubaugh
01/17/2019, 9:04 PMalien4u
01/17/2019, 9:10 PMzach_calh
01/17/2019, 9:41 PMvar xhr = new XMLHttpRequest();
xhr.open("POST", requestUrl, true);
xhr.onload = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
return resolve(xhr.responseText)
} else {
return reject(xhr.responseText);
}
}
xhr.withCredentials = true;
xhr.responseType = "text";
xhr.send(JSON.stringify(body));
zach_calh
01/17/2019, 9:43 PMzach_calh
01/17/2019, 9:43 PM