---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# OAuth 2.0 tutorial - create a REST message

# OAuth 2.0 tutorial - create a REST message {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Create a REST message and associated HTTP method to contact the Google service using
the OAuth 2.0 profile.

## Before you begin

Role required: web_service_admin and oauth_admin

You must have configured an OAuth
provider and profile using the Google API information and your OAuth
credentials.

## Procedure

1. Navigate to AllSystem Web ServicesREST Message.
2. Click New.
3. Enter a descriptive Name.
4. In the Endpoint field, enter <kbd class="ph userinput">https://www.google.com/m8/feeds/contacts/default/full</kbd>.  
   By using default instead of a specific username, the Google API uses the OAuth credentials to determine which account to get information from.
5. In the Authentication tab, set the Authentication type to OAuth 2.0.
6. In the OAuth profile field, select the Google contacts OAuth profile.
7. Right-click the form header and select Save.
8. Click the Get OAuth Token related link to request an authorization token from Google using the configured client ID and secret.
9. In the Request for Permission window that appears, click Accept to grant access to your Google contacts.  
   The token aquired is not directly accessible in your instance.
10. In the HTTP Methods related list, select the GET method.
11. Leave the HTTP method Authentication type as -- None -- to use the OAuth profile from the parent REST message record.
12. On the HTTP Request tab, add a new row to the HTTP Headers related list with a Name of <kbd class="ph userinput">GData - Version</kbd> and a Value of <kbd class="ph userinput">3.0</kbd>.
13. Right-click the form header and select Save.
14. Click the Test related link.  
    The test result should display an HTTP Status of 200, and the result of the contacts API call.
{#t_OAuthDemoCreateRESTMessage__steps_amx_5vb_ss}
**Previous topic:** [OAuth 2.0 tutorial - create an OAuth provider and profile](https://servicenow-prod.fluidtopics.net/NKBl77dMjQW3KEfuM1d2Lg "Set up the Google service as an OAuth provider in ServiceNow by entering your client information, Google API URLs, and configuring the OAuth profile.")  
**Next topic:** [Outbound REST mutual authentication](https://servicenow-prod.fluidtopics.net/1mbo_0z78~E~gUcplewrHw "Mutual authentication causes the web service provider and consumer to authenticate with each other before communicating.")

*[\>]: and then


