- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2025 04:28 AM
Hello all,
Using a scripted REST API, a catalog item request will be created.
The customer enters a URL along with some parameters in a variable.
So, I have configured a rest outbound message and calling that from business rule before task closure.
Now, the customer is saying that he will change the Base URL every time he creates a request in service-now and we need to hit that URL.
So, we cannot use rest outbound message here.
So, can someone tell me how to hit the dynamic URL every time we receive it in a catalog item variable??
What script we need to write?
Regards,
Lucky
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2025 09:03 PM
you can set the endpoint using RESTMessageV2 this function setEndpoint(), don't configure endpoint there in REST Message or whatever you give it will pick based on what you pass in this method in script
RESTMessageV2 - Scoped, Global
OR Best Way
1) Don't use REST Message and don't create REST Message, you can still consume the endpoint and send request without creating a REST Message in system using Recordless REST Message
2) check this link
Recordless RESTMessageV2 example
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-07-2025 08:32 PM
Hope you are doing good.
Did my reply answer your question?
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-11-2025 08:20 AM
Hello Ankur,
This is working. Good for me.
But I have a small query.
Here we are showing up basic auth creds, admin and admin (that is user name and password)
But how can I do if I don't want to show the password there?
Is there any other way?
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 05:03 AM
Hello Ankur,
From the second pic of your last reply, I want to know how to hide the username and password that was hard coded in the script?
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 12:35 AM
Hello Ankur and Shivalika,
Thanks you both for your time.
I will make ANkur's comment as helpful, as I got the way to achieve this.
But @Ankur, I found the answer to my question and thank you.
Solved: How To Use "Basic Auth Credentials" In Scripts? - ServiceNow Community
Regards,
Lucky