Pagination
When listing jobs and their associated resources, this API uses pagination to automatically break large sets of results into smaller, manageable chunks.
A response from the API may therefore only include a subset of the results. If pagination is used, the response includes a pagination
property that contains more information. If there are more results available, the pagination
object includes a nextUrl
property that can be used to retrieve the next set of results. If there are no more results, the nextUrl
property is not present.
To retrieve all results:
- Make an initial request: Start by making a request to the API endpoint to fetch the first set of results.
- Check for ``nextUrl``: In the response, check if there is a
nextUrl
property. - Fetch the next set of results: If
nextUrl
is present, make a request to the URL specified innextUrl
to fetch the next set of results. - Repeat: Continue this process until there is no
nextUrl
property in the response, indicating that you have retrieved all the results.
Example
Consider an example where you are fetching job results for a specific job. The initial request might look like this:
- Initial request
GET https://developer.api.autodesk.com/flow/compute/v1/queues/{queueId}/jobs/{jobId}/outputs
- Response with
nextUrl
The response might include a
nextUrl
property if there are more results to fetch:{ "results": [ // ... list of results ... ], "pagination": { "nextUrl": "/flow/compute/v1/queues/queueId/jobs/jobId/outputs?paginationToken=xyz..." } }
Show More
- Response with
- Fetch the next set of results
To fetch the next set of results, you would make a request to the URL provided in the
nextUrl
property:GET https://developer.api.autodesk.com/flow/compute/v1/queues/{queueId}/jobs/{jobId}/outputs?paginationToken=xyz...
- Check for more results
The request will return the next set of results, along with another
nextUrl
if there are still more results to fetch. If thenextUrl
property is not present in the response, it indicates that there are no more results to fetch.
Repeat this process until the nextUrl
property is no longer present in the response.