04-07-2014 04:42 AM
we developed an own ASP.NET-based website for our UserHelpDesk that they can see informations about a users device. To get all BlackBerry10 devices we use the API with the following code:
GetUsersRequest request = new GetUsersRequest();
RequestMetadata metadata = new RequestMetadata();
metadata.clientVersion = ClientVersion;
metadata.locale = Locale;
metadata.organizationUid = OrgUid;
request.metadata = metadata;
GetUsersSearchCriteria searchCriteria = new GetUsersSearchCriteria();
request.searchCriteria = searchCriteria;
request.pageSize = 0;
GetUsersSortBy sortBy = new GetUsersSortBy();
sortBy.EMAIL_ADDRESS = true;
sortBy.value = "EMAIL_ADDRESS";
request.sortBy = sortBy;
GetUsersResponse response = service.getUsers(request);
The problem is now, that only 2000 devices come back as a result set! When we try to change the pageSize to 3000, then an error appears with message "pageSize too large" appears. Is there a possibility to get more than 2000 devices back from the service?
Solved! Go to Solution.
04-07-2014 07:43 AM
The GetUsersRequest call, and most calls in BWS, will paginate the responses to help with efficiency and load of the system. The call has a parameter "lastUserUid" which can be set to denote where the next query should begin, so say you make your call with 2,000 users listed and the last user in that list has an ID of "2000", if you pass that ID into the next GetUsersRequest then the query will begin at the next user ID, ex "2001", and continue from there.