Invoke server side script using REST API

Dorothy
Tera Contributor

Hi,

 

Do we have a REST API interface to invoke the server side scripts (not scripted apis) eg., sys_script_include, so to invoke these from outside SN. The logic would execute on server side only, but the invocation happens from outside using REST api and by passing the input values as needed by the script.

2 REPLIES 2

Prince Arora
Tera Sage
Tera Sage

@Dorothy 

 

I believe, for your case, the best practice is to create a scripted REST API in ServiceNow, mention your script in it, and trigger the scripted REST API from the external source.

 

 

Dorothy
Tera Contributor

As I mentioned I do not want to create api wrappers. Is there any direct OOB SN REST API way for this? If not, and if api wrapper is the only way, then is there a way to create just one general wrapper that is capable of invoking any server side script? How will the input parameters be taken care of in this scenario?