In v20240412, we are introducing a new method for fetching paginated data from our API.
Instead of specifying a page number, you now pass a cursor that identifies the first record of the page, along with the number of records you want to fetch.
New Pagination Parameters
- start_cursor: Use this to paginate backward. Starts empty.
- end_cursor: Use this to paginate forward. Starts empty.
- per_page: Number of results per page (default: 1000).
Response Page Info
Each response includes additional page information:
"page_info": {
"has_previous_page": false,
"has_next_page": false,
"start_cursor": "AAAAA",
"end_cursor": "BBBBBB"
}
Paginating Forward
The page_info
object contains the first and last cursor of the page. To paginate forward, include end_cursor
from the response in your next request.
With this approach, you only need to pass one parameter—end_cursor
—which fetches all records after the specified cursor.
Paginating Backward
To paginate backward, use start_cursor
from the response in your next request.
Similarly, this requires only one parameter—start_cursor
—which fetches all records before the specified cursor.
curl --request GET
--url '<https://nexhealth.info/procedures?subdomain=YOUR_SUBDOMAIN&location_id=YOUR_LOCATION_ID&per_page=100&start_cursor=WWWWW'>
--header 'Nex-Api-Version: v20240412'
--header 'Authorization: YOUR_BEARER_TOKEN'
Supported Endpoints
The following endpoints now support cursor-based pagination:
- Procedures
- Adjustments
- Charges
- Payments
- Claims
- Appointments