mmoen
11/21/2023, 2:47 PMvar suiteletURL = url.resolveScript({
scriptId: 'customscript_rl_test',
deploymentId: 'customdeploy_rl_test',
returnExternalUrl: false
});
var response = https.get({url: suiteletURL});
log.debug({title: "response", details: response});
But this is what I get:
SSS_INVALID_URL
{
type: "error.SuiteScriptError",
name: "SSS_INVALID_URL",
message: "The URL must be a fully qualified HTTPS URL.",
id: null,
stack: [
"createError(N/error)",
"execute(/SuiteScripts/CSG_SS_Test.js:16)",
"createError(N/error)"
],
cause: {
name: "SSS_INVALID_URL",
message: "The URL must be a fully qualified HTTPS URL."
},
notifyOff: false,
userFacing: true
}
Obviously I can return a FQDN from getURL, but then I'd need to pass authentication info, which is what I'm trying to avoid here. Am I doing something obvious wrong? This looks identical to how I've done it in the past.Mike Robbins
11/21/2023, 3:17 PMhttps.requestRestlet()
rather than url.resolveScript
followed by https.get
.
Authorization headers are automatically added to your request so you don't have to build them.erictgrubaugh
11/21/2023, 3:17 PMmmoen
11/21/2023, 3:18 PMerictgrubaugh
11/21/2023, 3:18 PMmmoen
11/21/2023, 3:19 PMmmoen
11/21/2023, 3:22 PMvar response = https.requestRestlet({
//body: "", Optional, put body here for NON-GET methods
deploymentId: 'customdeploy_rl_test',
method: 'GET',
scriptId: 'customscript_rl_test',
//urlParams: {} Optional, put parameters here
});