- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 07:59 PM
Hi,
I have created the external client oAuth access token through https://<instance>.service-now.com/oauth_token.do.
How do i use this access token in scripted REST api script for authentication ?
Regards,
Sagaya.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2020 03:22 AM
Glad to know that it worked.
Please close the thread as answered by marking my response as correct and helpful If I was able to help/guide you.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 04:30 AM
Hi,
Are you sending token in this manner
Authorization <AccessToken>
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 06:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 07:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 09:05 AM
Hi Ankul ,
Yes I have given and still got different error and 401 error.
Step1 :
Get access token
Step 2:
Pass it in the POST API
In the scripted REST API script , I have called the table API and got 401 error while servicenow tried to execute that table API.
23:57:25.978 *** Start #207214 /api/mamb/ivr, user: sagaya.r.stephen
23:57:26.9 reqheader : message_id-->Test
23:57:26.9 reqheader : channel_id-->ivr
23:57:26.10 MSISDN : 60123456781
23:57:26.11 MSISDN value : mobile_phone=60123456781
23:57:26.11 IVR Interaction validation : {" Message Id" :"Test" ,"Channal Id" :" ivr" }
23:57:26.12 contactTableEndPoint: https://dev.service-now.com/api/now/table/customer_contact?mobile_phone=60123456781
23:57:26.126 httpStatus:401
23:57:26.126 responseBody:{"error":{"detail":"Required to provide Auth information","message":"User Not Authenticated"},"status":"failure"}
23:57:26.128 [DEBUG] http response status_code: 401
But when i use the basic authorization its working fine.
So while use the oAuth , dont use any other API inside the scripted REST API script ?
Regards,
Sagaya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2020 05:39 AM
seems issue with the scripted rest API or the content type being sent over Postman
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader