Question

Best way to handled paged results from API?

  • 10 March 2022
  • 3 replies
  • 108 views

I am pulling data from an API using the Web Hook connector. I get the data fine but it limits the number of records and uses a next url for the next batch. What is the recommended way to page through each set of results and store them in a final list of items?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +14

Hi @Andrew-GraceOC 

Depends on the API documentation for how they handle pagination.

Are you able to provide a link to the documentation to reference?

@Troy Tessalone Let me see if I can find the documentation, but maybe this will help. This is what gets returned:

 

links

self

https://api.planningcenteronline.com/people/v2/people/8675309/workflow_cards?filter=assigned

next

https://api.planningcenteronline.com/people/v2/people/8675309/workflow_cards?filter=assigned&offset=25

Here is a link to the documentation

Planning Center API Documentation

 

Here is an example of what it returns.

links

self

https://api.planningcenteronline.com/people/v2/people/8675309/workflow_cards?filter=assigned

next

https://api.planningcenteronline.com/people/v2/people/8675309/workflow_cards?filter=assigned&offset=25