Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm new to using API's and I don't understand pagination enough to get all the data from Planning Center People. I connect, and can get data but depending on the settings I choose for pagination, I get anywhere from 25 to 1632 of 6507 records. I don't understand what I should be doing. The API Explorer Planning Center provides for developers (I'm a wannabe developer) gives this server response:
"root":{ 4 items
"links":{ 2 items
"self": "https://api.planningcenteronline.com/people/v2/people"
"next": "https://api.planningcenteronline.com/people/v2/people?offset=25"
}
I interpreted this to mean I should use Pagination one of these - I've tried both and cannot get all the 6507 records:
I tried various "offset" settings but simply cannot get this to work. Any help anyone can provide would be most appreciated. - super indebted!!
Can you try to add this parameter to your URL?
per_page=100
It will be something like: https://api.planningcenteronline.com/people/v2/people?per_page=100
Sorry again, I can't test myself to give you the right answer. Going blind here!
Hi @DrB1,
I don't have access so far to this API, but it looks similar to one that I did before. Can you please try this on your REST API Connection? Don't worry about Offset or anything else. You should be good.
@marksouzacosta It errors out -
I think that indicates the pagination is working. But the number of records per call is small compared to the total number of records you have, so you are reaching the limit of requests. I found some details here:
https://developer.planning.center/docs/#/overview/rate-limiting
Let me try to find a better way to get that...
Can you try to add this parameter to your URL?
per_page=100
It will be something like: https://api.planningcenteronline.com/people/v2/people?per_page=100
Sorry again, I can't test myself to give you the right answer. Going blind here!
Yes, @marksouzacosta !! Adding the per_page=100 to my URL worked! Thank you so much!
You are very welcome.