Role to access tables using REST API

sahilkhanna
Tera Expert

I can use the APIs below to get data using the "admin" role.

 

{{instanceUrl}}/api/now/table/sys_ui_element

 

However, when I access these using roles like "sn_customerservice_agent", I get the below error.

 

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

 

If I create a new role for this API, can I know what permissions are needed to access this table?

1 ACCEPTED SOLUTION

Mark Manders
Mega Patron

An API user still needs the access to the tables/fields it is writing to. The 'sys_ui_element' table is not one that a customerservice agent has access to.

You should also really ask yourself why you want this table to be accessed by an api user.

 

Check the read/write ACLs on the table to find the lowest role needed (but I think it's going to be admin, or at least form_admin). 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

1 REPLY 1

Mark Manders
Mega Patron

An API user still needs the access to the tables/fields it is writing to. The 'sys_ui_element' table is not one that a customerservice agent has access to.

You should also really ask yourself why you want this table to be accessed by an api user.

 

Check the read/write ACLs on the table to find the lowest role needed (but I think it's going to be admin, or at least form_admin). 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark