Modified on Tue, 30 Aug 2022 at 01:22 PM

Q: I am trying to query more results than the maximum return size allows. Can I do pagination?

Yes. We recommend using pagination to fetch the results in smaller chunks through multiple API calls with the help of max and subsequent offset parameters. You will receive an error like below if you run into the maximum result limit.

{object} length parameter cannot be greater than 100 (current value={value_sent})

We have laid out an example below using the workflow endpoint.

curl -X GET "https://$TOWER_SERVER_URL/workflow/$WORKFLOW_ID/tasks?workspaceId=$WORKSPACE_ID&max=100" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer $TOWER_ACCESS_TOKEN" 

curl -X GET "https://$TOWER_SERVER_URL/workflow/$WORKFLOW_ID/tasks?workspaceId=$WORKSPACE_ID&max=100&offset=100" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer $TOWER_ACCESS_TOKEN" 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article