【问题标题】:Uncaught PodioBadRequestError: "Must specify either 'embed' or 'url'"未捕获的 PodioBadRequestError:“必须指定 'embed' 或 'url'”
【发布时间】:2018-09-23 18:10:27
【问题描述】:

我需要为 Podio 中的嵌入字段设置值,这是我的代码:

            $field_id='pdf-property-information';
            $options=$item->fields[$field_id]->values;
            if(empty($options)) 
                $item->fields[$field_id] =  new PodioEmbedItemField($field_id);

            // Create embed
            $embed = PodioEmbed::create(array('url' => $pdf_property_information));

            // Set using object
            $item->fields[$field_id]->values = $embed;

            // Set using associative array
            $item->fields[$field_id]->values = array('embed_id' => $embed->embed_id);

这是我得到的错误:

致命错误:未捕获的 PodioBadRequestError:“必须指定 'embed' 或 'url'" 请求 URL:http://api.podio.com/item/826141668 堆栈跟踪:#0 /home/apibind/public_html/mail_chimp/podio-php-4.3.0/lib/Podio.php(355): Podio::request('PUT', '/item/826141668', Array) #1 /home/apibind/public_html/mail_chimp/podio-php-4.3.0/models/PodioItem.php(183): Podio::put('/item/826141668', Array) #2 /home/apibind/public_html/mail_chimp/podio-php-4.3.0/models/PodioItem.php(66): PodioItem::update(826141668, 数组, 数组) #3 /home/apibind/public_html/sourcingplatform/trunk/add.php(403): PodioItem->save() #4 {main} 抛出 /podio-php-4.3.0/lib/Podio.php 第 289 行

【问题讨论】:

    标签: podio


    【解决方案1】:

    您必须使用数组键 "embed" 传递 embed_id。在这里,您的最后一行将是,

     // Set using associative array
     $item->fields[$field_id]->values = array('embed' => $embed->embed_id);
    

    【讨论】:

      猜你喜欢
      • 2014-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多