- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 09:24 PM
Hi Everyone,
I have created a custom Scripted REST API. I am sending a data to post in incident using postman, where I get the payload in form of JSON and which I send from scripted REST API to script include. I am able to get payload, but I am not able to get the integration URL which is coming from postman.
I want this integration URL because when we will send data from backend then it will have some parameters in integration URL, which I will be using in script include.
Can anyone suggest how can I get integration URL?
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 10:21 PM - edited 04-27-2025 10:30 PM
Hello @Abhijit Das7 ,
You can use request.queryString to get the full URL query.
You can also use request.queryParams to check for individual parameters.
Example:
Sent the following request:
Result:
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 09:36 PM
you won't get the URL in scripted REST API
the parameter you want should be passed in JSON request body itself since it's a POST method
Consider this scripted REST API is shared with 3 different external teams and each team can include a particular unique JSON key value pair in the JSON request body which you can access in script and you will know which external team is consuming this endpoint
Example
{
"requestFrom":"TeamA"
}
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-27-2025 10:21 PM - edited 04-27-2025 10:30 PM
Hello @Abhijit Das7 ,
You can use request.queryString to get the full URL query.
You can also use request.queryParams to check for individual parameters.
Example:
Sent the following request:
Result:
Regards,
Robert