{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1384,"path":"api-reference/web-services/t_OAuthDemoCreateRESTMessage.md","title":"OAuth 2.0 tutorial - create a REST message","bundle":null,"doc_type":null,"release":"australia","body":"\n# OAuth 2.0 tutorial - create a REST message\n\nCreate a REST message and associated HTTP method to contact the Google service using the OAuth 2.0 profile.\n\n## Before you begin\n\nRole required: web\\_service\\_admin and oauth\\_admin\n\nYou must have configured an OAuth provider and profile using the Google API information and your OAuth credentials.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Web Services** &gt; **REST Message**.\n\n2.  Click **New**.\n\n3.  Enter a descriptive **Name**.\n\n4.  In the **Endpoint** field, enter `https://www.google.com/m8/feeds/contacts/default/full`.\n\n    By using default instead of a specific username, the Google API uses the OAuth credentials to determine which account to get information from.\n\n5.  In the **Authentication** tab, set the **Authentication type** to **OAuth 2.0**.\n\n6.  In the **OAuth profile** field, select the Google contacts OAuth profile.\n\n7.  Right-click the form header and select **Save**.\n\n8.  Click the **Get OAuth Token** related link to request an authorization token from Google using the configured client ID and secret.\n\n9.  In the Request for Permission window that appears, click **Accept** to grant access to your Google contacts.\n\n    The token aquired is not directly accessible in your instance.\n\n10. In the **HTTP Methods** related list, select the **GET** method.\n\n11. Leave the HTTP method **Authentication type** as **-- None --** to use the OAuth profile from the parent REST message record.\n\n12. On the **HTTP Request** tab, add a new row to the **HTTP Headers** related list with a **Name** of `GData - Version` and a **Value** of `3.0`.\n\n13. Right-click the form header and select **Save**.\n\n14. Click the **Test** related link.\n\n    The test result should display an **HTTP Status** of 200, and the result of the contacts API call.\n\n\n**Parent Topic:**[Outbound REST with OAuth 2.0 profile tutorial - integrating with Google Contacts API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/c_OAuth2ProfileTutorialGoogle.md)\n\n**Previous topic:**[OAuth 2.0 tutorial - create an OAuth provider and profile](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/t_OAuthDemoCreateProvider.md)\n\n**Next topic:**[Outbound REST mutual authentication](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/c_OutboundRESTMutualAuthentication.md)\n\n"}}