Paging issues with /api/now/v1/table/sys_user API

Jordan M1
Kilo Explorer

Hello,

We are using the /api/now/v1/table/sys_user API to retrieve a list of users to show our customers.  For some reason, for one of our customers, the paging seems to not be behaving like we expect.  We are using the following query string parameters: sysparm_offset=0&sysparm_limit=1000&systparm_query=ORDERBYuser_name, but for some reason we do not get back a full 1000 on our page one request.  Our customer has ~58k users that should be returning on this API, so I would expect 59 pages of data with only the last one returning less than 1000.

Is this expected behavior do to something like users existing but being deactivated?  If it is expected behavior, do I need to ask for page 2 by adding the full 1000 to the offset, or just the amount returned?

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Hi

check whether there are any ACLs or any other restrictions in place which prevents returning all records in case the requesting user is not an admin. 

Kind regards
Maik

Sorry for not responding quicker, had to wait for the customer to respond.  They confirmed that the same user being used for our integration is able to retrieve all of their users through hitting the API on Postman.  I am waiting to here back to see exactly how they are requesting through Postman, but to follow up here, would permissions be able to cause a less than pagesize requested result set to return?  We are confident there are more users than are returning and saw the same issue previously when our pagesize was 200 instead of 1000 where we only got back 196 instead of the full requested size.  

To be honest many details and information are missing and therefore - without any deeper investigations on your instance - I am not able to answer it. 

Maik

What info is missing?  I'm happy to provide anything I can.  I'm simply asking generically, is it possible for the API to return less than pageSize requested?