简体   繁体   中英

Podio Api - Create item error - “Invalid value null (null): must be Range”

I am trying to create an item with relationship field with multiple references like this.

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

While creating item it shows error PodioBadRequestError: "Invalid value null (null): must be Range". I have only these two fields in this app.

I get the same error with single reference also.

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

Any help?

This one should work

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

I've tested this for Ruby code and that works well :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM