Get Record Count with REST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2015 10:12 AM
Hi,
I am not able to get the count for the sys_whitelist_member table using REST calls. Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2015 10:20 AM
You can use the REST Aggregate API.. You can make use of REST API explorer. I tried to get the count for the sys_user table using the below request..
HTTP Method / URI | https://dev12270.service-now.com/api/now/v1/stats/sys_user?sysparm_limit=10&sysparm_count=true |
Headers
Accept | application/json |
Content-Type | application/json |
X-UserToken | 324bf65e4f5886000bdfb5e18110c7108ca15c69e63c9ea731a3227c648402689c8cc1ba |
Response Body
{ "result": { "stats": { "count": "560" } } }
Also, make sure you have access to the requested table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2015 01:33 AM
Hi Probir,
Worth mentioning the REST API explorer and the REST Aggregate API are available from Fuji onwards?
Eureka and earlier do not have this functionality.
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2021 03:01 AM
Is it possible to get the Count of X table with a filter applied? Something like...
sysparm_query=active=true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2015 10:38 AM
More likely due to restricted access.