Paging Methodology - nonduality345/Convos GitHub Wiki

Paging Methodology

Paging in the system can be achieved using three specific query string variables:

Parameter Name Parameter Type Description
index Integer >= 0 The index of the page to retrieve. Pages are zero based, so the first page starts at index 0. The default value for this parameter is 0.
count Integer >= 1 The number of objects per page. The default value for this parameter is 10. The maximum value for this parameter is 50.
before DateTime The upper bound on the date created of Messages or the date of the last message for Convos to retrieve. This value should be in ISO 8601 format. The default value for this field is 9999-12-31T23:59:59.

The before parameter generally should reflect the minimum value for the DateOfLastMessage value for Convos and the DateCreated value for Messages of the current set of objects. This is to ensure that when you page to the next set of objects, the paging scheme is respected and objects are returned in their proper order. For the case of Convos, where the DateOfLastMessage is a nullable field, if all of the values are null, the before parameter carries over the before parameter used for the current set. Failure to respect this scheme may result in the same object appearing in multiple pages, particularly when new objects are added. Each request which requires paging returns a custom header named X-URI-Next-Page which holds the URI to the next set of results for the client to use.