- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2024 01:42 AM - edited ‎09-22-2024 03:06 AM
Hi everyone,
I have created a client script for a ServiceNow Catalog Item, along with a corresponding Script Include. However, I am consistently encountering my created "API call failed" error message. This Script Include is currently very basic, designed to simply return the string 'success' and so it should response the error message "
.
I have attempted to trigger the Script Include using both 'onChange' and 'onLoad' client scripts, but neither approach has been successful in receiving the expected 'success' response. I am unable to determine the root cause of this failure. Could you please help me identify the issue and provide guidance on how to resolve it? Thank you!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2024 03:47 AM - edited ‎09-22-2024 03:48 AM
@JohnDF I found an issue with your script include, initially you created a server side script include(Client callable unchecked), and later on chose to make it a client callable. Please update your script include as follows and see if it works.
var RErequestAPI = Class.create();
RErequestAPI.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getCatItems: function(){
return 'success';
},
type:'RErequestAPI'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2024 03:47 AM - edited ‎09-22-2024 03:48 AM
@JohnDF I found an issue with your script include, initially you created a server side script include(Client callable unchecked), and later on chose to make it a client callable. Please update your script include as follows and see if it works.
var RErequestAPI = Class.create();
RErequestAPI.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getCatItems: function(){
return 'success';
},
type:'RErequestAPI'
});