Discussions
links.next can only retrieve one next cursor parameter
Hi,
I'm having a case where I'm trying to retrieve all the persons from the api. When I call the V2 endpoint https://api.personio.de/v2/persons
I get the persons, and the _meta link to the next page:
"_meta": {
"links": {
"self": {
"href": "https://api.personio.de/v2/persons"
},
"next": {
"href": "https://api.personio.de/v2/persons?cursor=cur_b2Zm..."
}
}
}
Now when I call the endpoint with the cursor parameter given in _meta.next.href
like https://api.personio.de/v2/persons?cursor=cur_b2Zm...
, I only get the next page with links pointing to the same page like:
"_meta": {
"links": {
"self": {
"href": "https://api.personio.de/v2/persons?cursor=cur_b2Zm...
},
"next": {
"href": "https://api.personio.de/v2/persons?cursor=cur_b2Zm..."
}
}
}
Now of course since the next link is the same as the self link, I'm only getting the same 10 responses, and I can't get anymore persons from the api, so the max I could retrieve is 20 persons.
I tried increasing the limit
parameter to limit=50
but the same issue happens here also, and I get stuck on the second page, so I can only get max 100 results from the api. So the issue is not that we would have only 20 or 100 persons in the records.
Now the api docs say that: ...your subsequent call has to include the cursor in order to retrieve the next list of resources. If cursor is missing, the first page is returned.
I'm doing that exactly, so providing the cursor in the call but the next 3rd list of persons seems to never be returned on the 2nd call. This issue is happening regardless of the client that I call the endpoint with.
Is it me or the api here that is having challenges?
Best regards,
Tarmo