Podio Php - limit the amount of item fields returned

笑着哭i 提交于 2019-12-02 17:00:35

问题


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


回答1:


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)'));


来源:https://stackoverflow.com/questions/45909025/podio-php-limit-the-amount-of-item-fields-returned

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!