2016-09-19 56 views
1

我想創建一個與關係字段的項目,像這樣的多個引用。Podio Api - 創建項目錯誤 - 「無效的值null(null):必須是範圍」

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

任何幫助?

回答

2

這一個應該工作

$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] }) 
相關問題