sep 22, 20214:42 AM - editado sep 23, 202111:18 AM
Participante
PHP Pagination
Hi,
Hopefully someone can give me a nudge in the right direction, I'm building a portal where users can create a 'Project' (custom object) record and associate it with other objects. I have this all functional except one issue and that is being able to get more than 100 results in an api call.
I know the Searhc API allows up to 10,000 using the pagination feature but I'm looking to see if anyone has any guidence on a good method to loop through all the results using PHP.
Below is an example of an api call for me searching for all 'Projects' that have an id. This returns the first 100 perfectly. I'm then adding the projects into a 'Table'.
Looking for some help on how i'd be able to loop through calling the api until I have all the projects?
sep 23, 20214:37 AM - editado sep 23, 202111:17 AM
Participante
PHP Pagination
This might not be the cleanest way, but I think I managed to get the outcome I am after by building this function. It loops through and recalls the api if there is an 'after' value in the result of the previous api call.
It then adds a '<td>' to a table to show all projects.