- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2023 04:55 AM - edited ‎05-25-2023 10:58 AM
How to make a REST request from script include in ServiceNow.
I want to send an ajax request to an external application and then fetch data from that. I am able to do it in ServiceNow client script using jquery but how to do this in Script include?
Thank you
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 08:16 AM
A Glide Ajax is used to make server requests from a client script. So you would use that in a scenario where you have a client script and a script include. The client script would call the script include using the Glide Ajax API to execute the server script.
If you need to make an API call to an external application inside of a client script, you would have to make the REST/SOAP call inside your script include, and call the script include from the client script using a Glide Ajax.
Glide Ajax cheat sheet from another community member: https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet/ta-p/2312430
RESTMessage v2 API: https://developer.servicenow.com/dev.do#!/reference/api/utah/server/c_RESTMessageV2API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2023 08:16 AM
A Glide Ajax is used to make server requests from a client script. So you would use that in a scenario where you have a client script and a script include. The client script would call the script include using the Glide Ajax API to execute the server script.
If you need to make an API call to an external application inside of a client script, you would have to make the REST/SOAP call inside your script include, and call the script include from the client script using a Glide Ajax.
Glide Ajax cheat sheet from another community member: https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet/ta-p/2312430
RESTMessage v2 API: https://developer.servicenow.com/dev.do#!/reference/api/utah/server/c_RESTMessageV2API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2023 10:18 PM
Hello
I want to make an API call to an external application from Script Include. How to do this?