Sorting and Pagination
The Core API supports sorting and pagination for endpoints that return arrays of resources. The sorting mechanism places the resources in order; the pagination mechanism then returns a specific range of those ordered resources. You control sorting and pagination through URL query parameters.
A GET
request to the /users
endpoint returns an array of users.
By default, the sorting mechanism places the most recently modified users at the top of the sort order (sort_by=-lastModifiedTime
) and the pagination mechanism then returns the first five users (count=5&start_index=0
).
The following URL shows this default setting in an explicit form:
The next five users in the sort order could then be returned with this URL (start_index
is now set to 5
):
Query parameter details
Copy section link
The following table provides details on the URL query parameters that control the sorting and pagination of returned arrays.
Query Parameter | Description | Values |
---|---|---|
sort_by |
Field on which to sort.
Use any field in the resource model, or one of the system fields NOTE: You must sort using system field names such as |
Allowable Values: Default Value: |
count |
Specifies the number of resources to return. |
Allowable Values: Default Value: |
start_index |
Specifies the sort order index from which to begin returning data. |
Allowable Values: Default Value: |
Response field details
Copy section link
Name | Type | Description |
---|---|---|
count |
integer |
The number of resources returned. Allowable Values: |
start_index |
integer |
The sort order index of the first resource in the returned array. Allowable Values: |
end_index |
integer |
The sort order index of the last resource in the returned array. Allowable Values: |
is_more |
boolean |
A value of Allowable Values: |
data |
array of objects |
Contains the returned resources. |