Sim Greenbaum
08/14/2025, 6:57 PMeblackey
08/14/2025, 7:49 PMSim Greenbaum
08/14/2025, 8:04 PMvar secretId = 'custsecret_your_secret_id';
var secretValue = secret.get({ id: secretId });
Sim Greenbaum
08/14/2025, 8:06 PMSim Greenbaum
08/14/2025, 8:07 PMtech_ph2019
08/14/2025, 8:15 PMSim Greenbaum
08/14/2025, 8:19 PMSim Greenbaum
08/14/2025, 8:19 PMSim Greenbaum
08/14/2025, 8:32 PMSim Greenbaum
08/14/2025, 8:35 PMcustsecretrails_seceret_id
Bruce Backman
08/15/2025, 12:29 PMvar sKey = https.createSecureString({ input: "{custsecretrails_seceret_id}" });
//...
var header = new Array();
header["secret-header"] = sKey;
//...
var response = <http://https.post|https.post>({
url: "https:\\<http://consoso.com|consoso.com>\api",
body: JSON.stringify(obj),
headers: header
});
Using the secret in the request body (using credentials field):
var requestBody={
secretFieldInRequest="{custsecretrails_seceret_id}",
otherFieldInRequest="sample"
}
// ...
<http://https.post|https.post> ( {
url : url
, headers: headers
, credentials: ["custsecretrails_seceret_id"]
, body : body
} );
Either way, N/Https expands the secret on its way onto the wire. You never actually retrieve it (unless your request just happens to be aimed at a service like httpbin.org that will send your request back to you) .