Getting insufficient rights to query records via REST API using admin credential

dariensharif
Kilo Contributor

Using REST need to extract to pieces of data.

1)  Count of VMware Templates in use and I am able to extract this data by the following GET

    {{server}}{{path}}/stats/cmdb_ci_vmware_template?sysparm_count=true

2)  Count of VMware Templates that have credentials and I am unable to extract this data using GET

    {{server}}{{path}}/stats/cmdb_ci_vmware_template?sysparm_query={credential}=true&sysparm_count=true

   Get the JSON message using admin credentials

   {
       "error": {
             "detail": "No permission to read column(s): [{credential}]",
             "message": "Insufficient rights to query records"
        },
        "status": "failure"
    }

Either my query is not right or some parts of CMDB are not accessible via REST, even as admin. I think the issue is former but need confirmation and help. Thanks. 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Darien,

Can you check any query business rule on that table?

even with admin ACLs should not be an issue.

I assume you are consuming ServiceNow table from some 3rd party app

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

vinothkumar
Tera Guru
Can u check ACL on that particular table and check whether anything is not checked and there will be role mentioned for it. add that role to that account

dariensharif
Kilo Contributor

Thanks for the reply.

While exploring ACL and digging deeper into tables and columns, found ServiceNow REST API Explorer, digging deeper into the syntax for sysparm_query, was able to construct new GET URL that returned the correct value and with no permission issues.

 

GET {{server}}{{path}}/stats/cmdb_ci_os_template?sysparm_count=true

GET {{server}}{{path}}/stats/cmdb_ci_os_template?sysparm_query=name%3E0%5Ecredentials%3E0&sysparm_count=true

 

Issue resolved