api - Podio Api - 创建项目错误 - "Invalid value null (null): must be Range"

标签 api podio

我正在尝试创建一个具有多个引用的关系字段的项目,如下所示。

  $collection = new PodioCollection(array(
  new PodioItem(array('item_id' => 425989858)),
  new PodioItem(array('item_id' => 425987845))
  ));

  $response = PodioItem::create("16748745", array('fields' => array(
            "130415123"   => "+13334445552",
            "130415337"   => $collection
            )));

创建项目时显示错误 PodioBadRequestError:“无效值 null (null):必须是范围”。我在这个应用程序中只有这两个字段。

我也遇到了与单个引用相同的错误。

$response = PodioItem::create("16748745", array('fields' => array(
            "130415123"   => "+13334445552",
            "130415337"   => array('item_id' => 425989858)
            )));

有什么帮助吗?

最佳答案

这个应该可以工作

$response = PodioItem::create("16748745", array('fields' => array(
            "130415123"   => "+13334445552",
            "130415337"   => array(425989858, 425987845)
            )));

我已经针对 Ruby 代码进行了测试,效果很好:)

created_item = Podio::Item.create(app_id, 
                                 'fields' => 
                                            {'title'        => 'just for test', 
                                             'relationship' => [item_1_id, item_2_id] })

关于api - Podio Api - 创建项目错误 - "Invalid value null (null): must be Range",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39577410/

相关文章:

javascript - 在 JavaScript 上验证 GitHub API

java - 如何对帖子主体对象使用@SerializedName注释

json - 以纯文本或 JSON 格式发送 REST 响应?

java - OkHttp 不是以 UTF8 而是以百分比编码回复我

java - 如何使用 API 导出跑道中的评论部分

javascript - var platform = new PlatformJS 给出构造函数错误

css - 在 HTTPS iframe 跑道网络表单中注入(inject) CSS

json - Soundcloud API 没有明确支持使用 json 进行分页

javascript - 跑道 JS : Cannot successfully subscribe to push service

php - 跑道 API : Items that were referenced right before are sometimes missing in list of references