---
sourceDocument: Zurich API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/zurich/api-reference

 Release :

    - zurich

ft:locale :

    - en-US

ft:publication_title :

    - Zurich API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# REST OAuth example

# REST OAuth example {#ariaid-title1}

Release version: Zurich  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
This example shows how to authenticate an inbound REST request using OAuth.
In this example, the OAuth application registry entry has a client ID of `example_client_id` and a client secret of `example_client_secret`. Replace these values, and the user name and password
shown in the examples, with the values for your own OAuth application and REST user.

## Getting an access token

To request an access token, send a POST request to the oauth_token.do endpoint of your instance. This example uses the password grant type and passes the client ID, client secret, and the credentials of the user the token is
issued for. Replace the placeholder values with your own.

    curl -d "grant_type=password&client_id=example_client_id&client_secret=example_client_secret&username=example_user&password=example_password" https://<instance>.service-now.com/oauth_token.do

## Sample token response

If the request succeeds, the instance returns a JSON response like the following. The access_token value is the token you pass in the Authorization header of subsequent requests. The
refresh_token value can be used to request a new access token after the current one expires. The expires_in value is the number of seconds until the access token expires. The token
values shown here are placeholders, not real tokens.

    {
      "scope": "useraccount",
      "token_type": "Bearer",
      "expires_in": 1799,
      "refresh_token": "example_refresh_token_value",
      "access_token": "example_access_token_value"
    }

## REST request with OAuth token

To call a REST API with the token, include it in the Authorization header with the Bearer prefix. This example uses the access token from the previous response to retrieve records from the Incident table (Table API). Replace
`example_access_token_value` with the access_token value returned for your request.

    curl -H "Accept: application/json" -H "Authorization: Bearer example_access_token_value" "https://<instance>.service-now.com/api/now/table/incident"


