Outbound REST API help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 03:34 AM - edited 04-30-2025 04:08 AM
Hi,
I have been following the this article which has been really useful to create a REST Message: use-bearer-token-for-rest-message-authentication
The first REST Message is working and I am getting the token in the log message however the second REST Message is returning a 400 status code "Bad Request" response.
When I've tested the Rest Message with test values as the variable substitutes it's working fine and I'm getting a 200 status code with the expected response so I assume there is an issue with the script include.
I've checked that companyName, account, sortcode, type and token are all returning the correct values in a log message.
I've attached my script include code & REST Message and this is my script include code:
Can anyone give me any pointers?
Thanks,
Clare
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 03:45 AM
HI @ClareM ,
PLease do follow the steps mentioned in the below link for your solution
if you found this to be helpful please do tag this solution as helpful.
Thanks,
Abin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 03:56 AM
it would be nice if you could share the actual script here rather than image
Did you see what came in logs when you debugged?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 04:08 AM
Thanks for your feedback, I have updated my post
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 04:39 AM
how and from where are you triggering the script?
also what came in logs for the response body?
were you able to set the request body and print it and see if all values were replaced fine?
are you getting the token?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader