Podio Php - limit the amount of item fields returned

前端 未结 1 974
你的背包
你的背包 2021-01-28 00:48

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

相关标签:
1条回答
  • 2021-01-28 01:26

    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)'));
    
    0 讨论(0)
提交回复
热议问题