ServiceNow OAuth2 Account

Overview

You can configure your accounts in SnapLogic using the Designer or Manager. You can use this account type to connect ServiceNow Snaps with data sources that use the ServiceNow OAuth2 account.



Prerequisites

Account settings

Legend:
  • Expression icon (): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field/Field set Description
Label

String

Required. Specify a unique label for the account.

Default value: N/A

Example: ServiceNow OAuth2 Account

Instance

String/Expression

Required. Specify the instance to access ServiceNow endpoint. If your ServiceNow URL is https://abc.service-now.com, then the instance name is abc.

Default value: N/A

Example: https://abc.service-now.com

Client ID

String

Required. Provide the client ID to use for authorization. Learn more: Application configuration in ServiceNow portal to use in ServiceNow OAuth2 Account.

Default value: N/A

Example: 45b546f46b004d10d275c2b553bc7g44

Client Secret

String

Provide the client secret for authorization of OAuth2 account.

Default value: N/A

Example: zcvfc098adfdb343s

Access Token

String

Required. Auto-generated upon account authorization. The access token for the application that is generated when setting up the account for the endpoint.
Note: Access tokens have limited lifetimes; you must get a new access token after it expires.

Default value: N/A

Example: npo98yh

Refresh token

String

Auto-generated upon account authorization. The refresh token for the application that is generated when setting up the account for the endpoint.
Note: To access the API beyond the lifetime of a single access token, your application can obtain a refresh token. The application stores the refresh token for future use and automatically refreshes the access token before it expires.

Default value: N/A

Example: N/A

Access Token Expiration

Integer

The time (in seconds) until which the access token must be valid. It represents the number of refresh tokens per user account per client.
Note: If there is no date of expiration, -1 is the default value. In such cases, the access token is refreshed on a regular interval, for instance, every hour.

Default value: N/A

Example: 10

OAuth2 Endpoint

String

Required. Specify the OAuth2 endpoint in the following format to authorize the application.

https://<servicenow instance name>.service-now.com/oauth_auth.do

Default value: N/A

Example: https://myinstance.service-now.com/oauth_auth.do

OAuth2 Token

String

Required. Specify the value for OAuth2 token in the following format to get the access token.

https://<servicenow instance name>.service-now.com/oauth_token.do

Default value: N/A

Example: https://myinstance.service-now.com/oauth_token.do

Grant Type

Dropdown list

Choose an authentication grant type for your ServiceNow instance. Available options are:
  • authorization_code: This grant type is used to obtain access tokens and refresh tokens from the authorization server.
  • password: Exchanges your credentials for an access token. This grant type involves the traditional username and password login to obtain the user's credentials and makes a POST request to the server to exchange the password for an access token.

Default value: authorization_code

Example: password

Username

String

Specify the username to connect to ServiceNow.

Dependency: Appears when you select password as Grant Type.

Default value: N/A

Example: admin

Password

String

Specify the password to connect to ServiceNow.

Dependency: Appears when you select password as Grant Type.

Default value: N/A

Example: p@$$w019

Auto-refresh Token

Checkbox

Select this checkbox to enable auto-refresh of the access token before it expires. Otherwise, it might expire and will not be automatically refreshed.

Learn more about how the SnapLogic Platform handles token refresh failures.

Default value: Deselected

Note: Click Validate after entering the required details to ensure that all fields have been filled accurately. Click Apply to save the settings.