Creating Tasks in ServiceNow via REST message from a Third Party Application

Shantanu1
Tera Guru

Hi Experts!

 

I have a requirement where a Third party application can send API calls to the ServiceNow platform and create tasks with the details mentioned in the API call. What should be best way to achieve this and what details I would need to share with a third party App teams?

 

Any guidance will be appreciated here!

 

Thanks

7 REPLIES 7

Shantanu1
Tera Guru

Hi @DrewW @Jaspal Singh @Sandeep Rajput ,

 

Thanks for the response, I am inclined more towards using the Scripted Rest API and in the table API, I would need to expose the entire table.

 

I have created a Scripted Rest Api record with a "Post" resource record.

 

I am sending a JSON REST Call from Postman, as below:

Shantanu1_2-1698047195311.png

 

 
In the Scripted Rest API, I am trying to see the response, so that I can later use the info and create Tasks, my script is below
 
Shantanu1_1-1698047126552.png

 

 
But I am not getting a valid response and the logs shows up empty. Any assistance would be greatly appreciated
 
Shantanu1_0-1698047083799.png

 

@Shantanu1 Replace line number 5 in your scripted rest from gs.log(requestData); with gs.log(JSON.stringify(requestData));

 

This above line will show the response JSON in logs.

Thanks @Sandeep Rajput , It worked!