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