简体   繁体   English

如何在Podio API中所有项目数据

[英]How to all items data in Podio API

I am trying to get all items data using the Offset parameter. 我正在尝试使用Offset参数获取所有项目数据。 I have around 4500 numbers of data. 我有大约4500个数据。 Using PHP cURL code to retrieve all items (REST API). 使用PHP cURL代码检索所有项目(REST API)。

But how do I use the offset parameter along with maximum limit of 500? 但是,如何使用offset参数和最大限制500?

You should use the Podio PHP client library instead of doing everything from scratch. 您应该使用Podio PHP客户端库,而不是从头开始。 It'll save you a lot of work: http://podio.github.io/podio-php/ 它可以为您节省很多工作: http : //podio.github.io/podio-php/

PodioItem::filter() is the method you'd use. PodioItem :: filter()是您要使用的方法。 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: 一旦获得了第一组项目,就可以使用filtered属性来查看总共有多少个项目:

$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. 只需获取500个项目块中的项目,直到获得所有项目为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM