HttpRequestAuthedData - Scoped
-
- UpdatedJan 30, 2025
- 7 minutes to read
- Yokohama
- API reference
The HttpRequestAuthedData() API provides methods to access and set values in a signed REST or SOAP request.
- HttpRequestData: Build the API request.
- AuthCredential: Create a credential object or update an existing one. Use the credential to sign the request through the RequestAuthAPI class.
- RequestAuthAPI: Sign the request and return an HttpRequestAuthedData object.
- HttpRequestAuthedData: Get information about the signed request.
- GlideHTTPRequest: Send the signed request.
Before using these APIs, you must configure an authentication algorithm to sign the request and associate it with the credential used to authenticate the request.
Use this API in scoped scripts with the sn_auth
namespace identifier. You can instantiate this class using the constructor, or you
can return an HttpRequestAuthedData object from the generateAuth() method
in the RequestAuthAPI class.
HttpRequestAuthedData - HttpRequestAuthedData()
Instantiates an HttpRequestAuthedData object.
You can instantiate this class using the constructor, or you can return an HttpRequestAuthedData object from the generateAuth() method in the RequestAuthAPI class.
Name | Type | Description |
---|---|---|
None |
HttpRequestAuthedData - addHeader(String key, String value)
Adds a header to the HttpRequestAuthedData object.
Name | Type | Description |
---|---|---|
key | String | Name of the HTTP header. |
value | String | Value of the HTTP Header. |
Type | Description |
---|---|
void |
Example
HttpRequestAuthedData - addQueryParam(String key, String value)
Adds a query parameter to the HttpRequestAuthedData object.
Name | Type | Description |
---|---|---|
key | String | Name of the query parameter. |
value | String | Value of the query parameter. |
Type | Description |
---|---|
void |
Example
HttpRequestAuthedData - getCredentialValue()
Returns the credential value that was included when the request was signed.
Use a credential value to store a cookie, signature, or other value needed for an authentication algorithm. For example, create a Get Connection Info (GCI) step with a script that retrieves and stores a one-time token for a REST or SOAP call.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Text of the credential value. |
Example
This example shows the retrieval of a credential value.
Output:
HttpRequestAuthedData - getDirective()
Returns whether the signature is applied to the request in the header, as a query parameter, or as a credential value.
By default, the system applies the signature to the header. You can apply the signature as a query parameter or credential value by using the setDirective() API.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Whether the signature is applied to the header, as a query parameter, or as a
credential value. Values include:
|
Example
Output:
HttpRequestAuthedData - getHeaderMap()
Returns an object containing the headers that were included when the request was signed.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | Key-value pairs that define all of the headers included when the request was
signed. Each key-value pair includes these parts:
|
Example
Output:
HttpRequestAuthedData - getQueryMap()
Returns an object containing the query parameters included when the request was signed.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object | Key-value pairs that define the query parameters included when the request was
signed. Each key-value pair includes these parts:
|
Example
Output:
HttpRequestAuthedData - getStatus()
Returns the status of the request signing.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The status of the request signing. Possible values:
|
Example
Output:
HttpRequestAuthedData - getStatusMessage()
Returns a detailed message about the request signing. If the request signing fails, this method returns the error message.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | Message about the request signing. If the request signing fails, returns one of
these error messages:
|
Example
Output:
HttpRequestAuthedData - setCredentialValue(String credential_value)
Sets a credential value for the HttpRequestAuthedData object.
Use a credential value to store a cookie, signature, or other value needed for an authentication algorithm. For example, create a Get Connection Info (GCI) step with a script that retrieves and stores a one-time token for a REST or SOAP call.
Use the setCredentialValue() method to set the Credential Value data pill for REST, SOAP, and GCI steps in Workflow Studio.
Name | Type | Description |
---|---|---|
credential_value | String | Text of the credential value. |
Type | Description |
---|---|
None |
Example
This example shows how to set a credential value for a GCI step.
HttpRequestAuthedData - setDirective(String directive)
Defines whether to apply the signature to the signed request in the header, as a query parameter, or as a credential value.
Name | Type | Description |
---|---|---|
directive | String | Whether to apply the signature to the header, query parameter, or credential
value of the signed request. Values include:
|
Type | Description |
---|---|
void |
Example
HttpRequestAuthedData - setStatus(String status)
Sets the status of the request signing.
Name | Type | Description |
---|---|---|
status | String | The status of the request signing. Possible values:
|
Type | Description |
---|---|
void |
Example
Output:
HttpRequestAuthedData - setStatusMessage(String statusMessage)
Sets a status message for the request signing.
Name | Type | Description |
---|---|---|
statusMessage | String | Message to set for the request signing status. |
Type | Description |
---|---|
void |
Example
Output:
On this page
- HttpRequestAuthedData - HttpRequestAuthedData()
- HttpRequestAuthedData - addHeader(String key, String value)
- HttpRequestAuthedData - addQueryParam(String key, String value)
- HttpRequestAuthedData - getCredentialValue()
- HttpRequestAuthedData - getDirective()
- HttpRequestAuthedData - getHeaderMap()
- HttpRequestAuthedData - getQueryMap()
- HttpRequestAuthedData - getStatus()
- HttpRequestAuthedData - getStatusMessage()
- HttpRequestAuthedData - setCredentialValue(String credential_value)
- HttpRequestAuthedData - setDirective(String directive)
- HttpRequestAuthedData - setStatus(String status)
- HttpRequestAuthedData - setStatusMessage(String statusMessage)