Consuming API from servicenow

cloudv
Tera Contributor

There is a third party monitoring tool which has an API to create alerts, we want to constantly monitor that API and when there is an alert we want to create an incident into servicenow and output of the API is JSON.

how can we react to the alerts using rest methods if the third party tool share the connections details with us.

 

thanks

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hey @cloudv 

 

I would recommend that instead of attempting to constantly poll the endpoint to PULL updates, it would be much more efficient for the 3rd party tool to PUSH updates to ServiceNow. So give them a connection and have them push an incident into ServiceNow via the Now Table API.

 

If it is not possible for them to push data to your instance, then I would setup a Script Include that performs the necessary REST calls for you. Then from a scheduled job, you could simply call your method in the Script Include on whatever interval you would like.

 

You can get the sample script call from the REST message once you setup in your instance, but generally it should look like something in the script in the answer to this question: https://www.servicenow.com/community/developer-forum/rest-from-script-include/m-p/1394820

 

Hope this helps!

~Nick

 

View solution in original post

1 REPLY 1

Community Alums
Not applicable

Hey @cloudv 

 

I would recommend that instead of attempting to constantly poll the endpoint to PULL updates, it would be much more efficient for the 3rd party tool to PUSH updates to ServiceNow. So give them a connection and have them push an incident into ServiceNow via the Now Table API.

 

If it is not possible for them to push data to your instance, then I would setup a Script Include that performs the necessary REST calls for you. Then from a scheduled job, you could simply call your method in the Script Include on whatever interval you would like.

 

You can get the sample script call from the REST message once you setup in your instance, but generally it should look like something in the script in the answer to this question: https://www.servicenow.com/community/developer-forum/rest-from-script-include/m-p/1394820

 

Hope this helps!

~Nick