Podio Php - limit the amount of item fields return

2019-03-06 00:26发布

Is there any way that you can limit the fields that are retured when you filter for items in an app. Instead of returning all fields, I would like to return just the item-id and the title field

标签: php podio
1条回答
Viruses.
2楼-- · 2019-03-06 01:10

You can use fields parameter for that. More details on how it works and how else it could be used are right here: https://developers.podio.com/index/api in "Bundling responses using fields parameter" section.

Using fields to bundle objects can be a way to drastically reduce the amount of API requests you have to make.

Most likely you are looking for fields=items.view(micro) parameter. Podio API will return then only 5 values for each item: app_item_id, item_id, title, link, revision

PHP sample

$items = PodioItem::filter($appCreds->app_id, 
                           array('limit' => $maxItems, 
                                 'offset' => $offset, 
                                 'filters' => $filters ), 
                           array('fields' => 'items.view(micro)'));
查看更多
登录 后发表回答