I'm trying to create one big json file with all my contacts. Since the API returns max 100 contacts I have to work with pagination. My lack in php knowledge let me in the dark of how to achieve this. Can anyone point me in the right direction here?
Hi @Ilja-developer, I'd say the best option would be to wait for a response on stack overflow, or submit a github issue on their repo. I can't speak to why one PHP repo would work but one wouldn't as these are all external developers simply utilizing the HubSpot APIs. Perhaps their code doesn't work for every use-case?
Hi @Ilja-developer, I do not know much about pagination with PHP, but something like a while loop could work: https://www.w3schools.com/php/php_looping.asp/. You could execute a blog of code (the request) multiple times until the has-more property that gets returned is equal to false. After each loop, you can push the values into an array. I can't speak to specifics, but this is a common practice. Any PHP developers have example code that they could provide?
Hi @Ilja-developer, I've found the following repo on Github you might be able to check out. I can't personally provide any example code, but know we are working on building out our examples and a possible library in the future. Here's the Github repo: https://github.com/ryanwinchester/hubspot-php