Pagination
The ServiceM8 API implements cursor-based pagination for handling large datasets efficiently.
How It Works
To retrieve paginated results:
Initial Request: Include the cursor parameter with a value of -1
in your API request
Response: Each successful response returns up to 5,000 records
Next Page: The response includes an x-next-cursor
HTTP header containing a UUID for the next page
Subsequent Requests: Use the UUID from x-next-cursor
as the cursor parameter value in your next request
Final Page: When you've reached the last page, the x-next-cursor
header will be absent from the response
Example Implementation
GET /api_1.0/job.json?cursor=-1
Response Headers:
x-next-cursor: 550e8400-e29b-41d4-a716-446655440000
Next Request:
GET /api_1.0/job.json?cursor=550e8400-e29b-41d4-a716-446655440000
Continue this pattern until no x-next-cursor
header is returned, indicating you've retrieved all available records.
Using TypeScript?Use the ServiceM8 SDK and you'll get pagination support automatically.
Updated about 6 hours ago