I am trying to get all items data using the Offset parameter. I have around 4500 numbers of data. Using PHP cURL code to retrieve all items (REST API).
But how do I use the offset parameter along with maximum limit of 500?
I am trying to get all items data using the Offset parameter. I have around 4500 numbers of data. Using PHP cURL code to retrieve all items (REST API).
But how do I use the offset parameter along with maximum limit of 500?
You should use the Podio PHP client library instead of doing everything from scratch. It'll save you a lot of work: http://podio.github.io/podio-php/
PodioItem::filter() is the method you'd use. To set both limit and offset:
$items = PodioItem::filter(123, array('limit' => 500, 'offset' => 0);
Once you've gotten the first set of items you can use the filtered
property to see how many items there are in total:
$items = PodioItem::filter(123, array('limit' => 500, 'offset' => 0);
print $items->filtered;
It's just a matter of fetching items in 500 item chunks until you've gotten all of them.