Podio Php - limit the amount of item fields returned

294 Views Asked by At

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

There are 1 best solutions below

3
On BEST ANSWER

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