- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 02:15 AM
i calling an api endpoint to get an oauth token back. i need to pass through the body the : username,password and grant_type.
I am following exactly what works for me in a powershell script but i keep getting "invalid grant type" when trying to do via a rest message in service now.
this is the powershell working and returning a valid token.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 02:40 AM
Hi there!
Update your method as per below screenshot and try to test
and in content mention like this without this"{}"
grant_type=password&username=myusername&password=Mypassword
Please mark my answer correct and helpful if this resolves your issue.
Regards,
Palak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2022 02:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2023 10:48 PM
Thanks, this helped me as well.
The main problem I had was that I was provided from workday side with few details, but was really missing how the structure should looks like in the header and body of the rest message in ServiceNow.
At the end my POST message to get token looks like below with basic authentication where I needed to use in user name / pwd client id and client secret
With that POST call Im getting token that I use in next message GET to get data from source system
Second GET Message to get data from source system using new TOKEN from first post message
One question to all, maybe someone can answer.
If I have first POST message, second GET, can I pass from post message to GET message value of new token directly via variable substituion or somehow else without need to call REST message via script?
- directly in the interface above (images above)
/Petr