ServiceNow REST API with Table name for Alert

supalkc555
Kilo Explorer

Hi,

I have gone thru the below link to know about Table REST API of ServiceNow:

https://express.servicenow.com/support/documentation/r_TableAPIGETRecordMethod/

My requirement is to obtain all the record from Alert table using Table REST API i.e. 'GET /api/nowv1/table/(tableName)'.

Now my question is , what will be the name of the (tablename) for Alert in the API itself to get the alerts which are already created in the table and can be seen using via "manage the alert life cycle feature" by navigating "Event Management > Active Alerts" (See : http://wiki.servicenow.com/index.php?title=Managing_Alerts#Managing_the_Alert_Life_Cycle) ?

Actually I am very new in ServiceNow and I am not using on-premise ServiceNow instance rather using public sandbox as a full access of ServiceNow's latest release - where I want to perform some tests. Currently, I am implementing a custom web application wherein I want to obtain and show all the latest Alert available in public sandbox.

For that I want to use REST API for integrating sandbox Alert table. For example : https://sandbox.service-now.com/api/now/v1/table/<tablename>.

Now, while trying using the table name "em_alert" (as you mentioned) in the API i.e. https://sandbox.service-now.com/api/now/v1/table/em_alert, I am getting following response :

Invalid table em_alert - Status failure

This is because table name required in REST API is different with the table name defined for the database.

But when I use "incident" as <tablename> in the REST API, I got good response that comprises "All problems". The thing is that I could not figured it out in the response that which problem is "Alert" and which one is "Ticket"

My need is :

1) What is the rule I can apply on the incident response, that tell me the incident is for alert, not a ticket?

2) Can we have REST API Alert Table name for Alerts to use directly in the API to get "All Alerts" from the em_alert database table?

Need your help here.

regards

SK

1 REPLY 1

supalkc555
Kilo Explorer

I got the answer.



In order to work with servicenow event/alert, you need to plugin the Event Management module in your PaaS developer instance, if you are new in ServiceNow and want to do some R&D.



This link (https://developer.servicenow.com/app.do#!/home ) is for applying for new developer instance. First you need to register and then you will be getting the instance. Once you have the instance allocated, you are provisioned to add "Event Management" plugin and then your developer instance (so far free)   is a place for you to learn about ServiceNow Event Management system for doing research & development on event/alert   table API etc. **Note** : The developer instance may not support real monitoring features e.g. : (1) detect an event; (2) send an alert of an event;



The API for getting alert info is :


GET https://<your developer instance>.service-now.com/api/now/v1/table/em_alert with basicauth credential



regards


SK