{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":426,"path":"api-reference/rest-api-explorer/r_RESTOAuthExample.md","title":"REST OAuth example","bundle":null,"doc_type":null,"release":"australia","body":"\n# REST OAuth example\n\nThis example shows how to authenticate an inbound REST request using OAuth.\n\nIn this example, the OAuth token has a `client_id` of `a329c4515612210071a5e0c298ee2be8` and a `client_secret` of `password22`.\n\n## Getting an access token\n\n```cmd\ncurl -d \"grant_type=password&client_id=a329c4515612210071a5e0c298ee2be8&client_secret=password22&username=RESTUser&password=RESTUserPassword\"  https://<instance>.service-now.com/oauth_token.do\n```\n\n## Sample token response\n\n```json\n{\n\"scope\": \"useraccount\",\n\"token_type\": \"Bearer\",\n\"expires_in\": 1799,\n\"refresh_token\": \"jZPdkEVrWvtMjrspldNjIS0uWM4D7QV9mgmcQXDVo5Qa_GVvmdR6NOp7OM038EHJnd6nZpWocFer1NcJz4zwdw\",\n\"access_token\": \"2wRlsRCT2SYjCCJP91kwo2EFzj5qg4O3I3aC09e0-0hz6Ib3YK7If-LMiNorNuglfqbkL4AfkYC92KYHUCcbpQ\"\n}\n```\n\n## REST request with OAuth token\n\n```cmd\ncurl -H \"Accept:application/json\" -H \"Authorization:Bearer 2wRlsRCT2SYjCCJP91kwo2EFzj5qg4O3I3aC09e0-0hz6Ib3YK7If-LMiNorNuglfqbkL4AfkYC92KYHUCcbpQ\"  \"https://<instance>.service-now.com/api/now/table/incident\n```\n\n**Parent Topic:**[Enable OAuth with inbound REST](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/t_EnableOAuthWithREST.md)\n\n"}}