Is there any API exposed which can list the ServiceNow tables which had changes i.e entries made in a certain time interval?

Shrinil
Tera Contributor

I need to make regular API calls on couple of ServiceNow tables to see if any new records were created in the time interval.

I want to extend the support from two to hundreds of ServiceNow tables.

So rather than making an API call to each of the table and getting an empty response for most of them, I was looking for an API which gives the information about which table was updated in a given time internal, so that I make API calls to only those tables.

Let me know if there exists such an API which can help me.

Thanks.

11 REPLIES 11

Shrinil
Tera Contributor

I am not able to access sys_audit table via API.

Response:

{
    "error": {
        "message": "User Not Authorized",
        "detail": "User is unauthorized to access table: sys_audit"
    },
    "status": "failure"
}

I can access the sys_db_object table though. Can you help me with the changes that I have to make in order to access this table?

You can not access sys_audit table through API. Because it is not available for API call from servicenow.

You can create scripted Rest API and call multiple table there which you need.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Even if sys_audit table is available for API call; it might lead to performance issue as that table is OOB system table

To see sys_audit you need to update this system property and add that table name

Also ensure the API user you are using has valid READ Access to sys_audit

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Shrinil 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I was able to access the sys_audit table. Not the way you suggested, but by giving ITIL role to the table. However, this table contains information about metadata of other tables and does not tell me if any entry was made into a table.