Pagination
Details of how API responses are paginated.
Some of our List endpoints will return a paginated response if they cannot include all elements in the response. These List API methods share a common structure, accepting an cursor
query parameter and including a pagination
object in the response when more pages of results are available.
Pagination Format
The format of the pagination
object is:
Attribute | Type | Description |
---|---|---|
nextPath | string | The full path to retrieve the next page of results |
Usage
For the response below (/v1/manager-reviews
), the API tells us there are more results
available which we can continue to fetch by providing the given cursor
.
{
"data": [
{
"createdAt": "2023-06-27T05:00:04Z",
"employeeId": "dd47a7f0-04f2-4a2c-ab0d-1044b2633a6e",
"links": [
{
"rel": "employee",
"uri": "/v1/employees/dd47a7f0-04f2-4a2c-ab0d-1044b2633a6e"
},
{
"rel": "performance-cycle",
"uri": "/v1/performance-cycles/963b2d66-676b-44fe-aaa7-083e0f4c584f"
}
],
"managerId": "f4c8c678-5ebb-467f-8c6b-b0ede56678fe",
"managerReviewId": "18983e1d-4cb6-4bc0-85f0-853cff420f9c",
"performanceCycleId": "963b2d66-676b-44fe-aaa7-083e0f4c584f",
"performanceRating": {
"ratingBuckets": [
{
"title": "Needs Development",
"value": 1
},
{
"title": "Consistently Meets Expectations",
"value": 2
},
{
"title": "Often Exceeds Expectations",
"value": 3
},
{
"title": "Sets a New Standard",
"value": 4
}
],
"ratingQuestion": {
"description": "You can find more information about internal definitions of ratings here [insert link].",
"title": "Overall, how would you evaluate this person's performance?"
}
},
"processedAt": "2023-07-01T12:15:06Z",
"status": "incomplete",
"updatedAt": "2023-06-27T05:00:04Z"
}
...
],
"pagination": {
"nextPath": "/v1/manager-reviews?cursor=eyJnc2lSZXZpZXdUaW1lc3RhbXBQayI6IkFDQyM2N2M4MDU4NC04MTQwLTQwYzQtYjJlOC1jZTdhZjU1NTBmYzAjTVIiLCJnc2lSZXZpZXdUaW1lc3RhbXBTayI6IjIwMjMtMDctMDFUMTI6MTU6MDJaIiwicGsiOiJBQ0MjNjdjODA1ODQtODE0MC00MGM0LWIyZTgtY2U3YWY1NTUwZmMwIiwic2siOiJSRVYjTVIjYmYxYWJkNmMtODUyYi00MDU0LWI4ZjMtNzYyMGNkZTU5MTkwIn0="
}
}
We can then access the following page of results via:
curl -H "Authorization: Bearer <token>" https://api.cultureamp.com/v1/manager-reviews?cursor=eyJnc2lSZXZpZXdUaW1lc3RhbXBQayI6IkFDQyM2N2M4MDU4NC04MTQwLTQwYzQtYjJlOC1jZTdhZjU1NTBmYzAjTVIiLCJnc2lSZXZpZXdUaW1lc3RhbXBTayI6IjIwMjMtMDctMDFUMTI6MTU6MDJaIiwicGsiOiJBQ0MjNjdjODA1ODQtODE0MC00MGM0LWIyZTgtY2U3YWY1NTUwZmMwIiwic2siOiJSRVYjTVIjYmYxYWJkNmMtODUyYi00MDU0LWI4ZjMtNzYyMGNkZTU5MTkwIn0="
Once the list of results has been exhausted, the response will no longer include a pagination
object.
Updated 5 months ago