首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未登录的PodioBadRequestError:“必须指定'embed‘或'url'”

未登录的PodioBadRequestError:“必须指定'embed‘或'url'”
EN

Stack Overflow用户
提问于 2018-04-13 11:33:47
回答 1查看 152关注 0票数 2

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

代码语言:javascript
复制
            $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);

这就是我遇到的错误:

致命错误: Uncaught:“必须指定'embed‘或'url'”请求URL:http://api.podio.com/item/826141668堆栈跟踪:#0 http://api.podio.com/item/826141668Podio::PodioBadRequestError(’PUT‘,'/item/826141668',数组) #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::/home/apibind/public_html/mail_chimp/podio-php-4.3.0/models/PodioItem.php(66):(826141668,/home/apibind/public_html/mail_chimp/podio-php-4.3.0/models/PodioItem.php(66):,数组) #3 /home/apibind/public_html/sourcingplatform/trunk/add.php(403):PodioItem->save() #4 {main}抛入/podio-php-4.3.0/lib/Podio.php第289行。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-16 05:06:23

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

代码语言:javascript
复制
 // Set using associative array
 $item->fields[$field_id]->values = array('embed' => $embed->embed_id);
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49816043

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档