当一个 Webhook 被触发时,有没有办法得到org_id
它被触发的地方?(除了爬上触发的项目)
到目前为止,我发现的唯一解决方案是:
PodioItem::get($item_id);
获取 space_idPodioSpace::get($space_id);
得到完整的PodioOrganization::get_for_url($attributes = array());
我得到org_id
.
当一个 Webhook 被触发时,有没有办法得到org_id
它被触发的地方?(除了爬上触发的项目)
到目前为止,我发现的唯一解决方案是:
PodioItem::get($item_id);
获取 space_idPodioSpace::get($space_id);
得到完整的PodioOrganization::get_for_url($attributes = array());
我得到org_id
.请参阅https://developers.podio.com/index/api最底部的“使用字段参数捆绑响应”部分,了解如何使用fields
查询参数包含更多数据。甚至还有一个几乎可以为您服务的示例(它一直延伸到空间级别,但您可以将组织添加到它上面):
/item/{item_id}?fields=app.view(full).fields(space.view(full))
对于 podio-php,您可以执行以下操作:
$item = PodioItem::get($item_id, array('fields' => "app.view(full).fields(space.view(full))"));
使用PodioItem::filter
代替PodioItem::get
,我很确定你会得到预期的结果,所以试试这个:
$item = PodioItem::filter($item_id, array('filters' => "app.view(full).fields(space.view(full))"));
希望能帮助到你!