The Zurich release has arrived! Interested in new features and functionalities? Click here for more

REST API Call

ralph_campbell
Kilo Explorer

All,

I'm trying to pull data from the sys_audit table using the table API. How do I setup the ACL to allow the rest api user to read this table.

https://server.service-now.com/api/now/table/sys_audit?sysparm_query=sys_created_on%3C2017-07-11+22%...

response is:

{

      "error": {

              "detail": "2 records constrained due to ACL restrictions",

              "message": "User Not Authorized"

      },

      "status": "failure"

}

Thanks

6 REPLIES 6

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Hi Ralph,



Out of box there are 2 ACLs on sys_audit for read, that both require "admin" role, see example of one below. As an admin, you could add the role of rest as well.



Screen Shot 2017-07-12 at 9.59.06 AM.png


Shrinil
Tera Contributor

I am getting similar error while making API call to sys_audit.

Response: 

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

I am not sure how to give enough permissions to the user. 

Can someone help me and give me detailed steps so that I can successfully make the API call?

Thanks