我需要使用procfu在Podio中创建一个项目,像这样:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://procfu.com/exe/podio_item_create.pf");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Basic MjI4M***********************"] );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, HTTP_BUILD_QUERY(["app_id"=>"212*****","fields" => ["title"=>'tst']]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close ($ch);
print_r ($result);
但是脚本返回错误:
错误:PodioBadRequestError:“无效值null(空):必须为非 空”
答案 0 :(得分:0)
这是解决方案,如果有人需要的话:
curl_setopt($ch, CURLOPT_POSTFIELDS, HTTP_BUILD_QUERY(["app_id"=>"********","fields" => json_encode(["title"=>'tst'])]));
我不明白为什么这个问题被否决了,这是一个非常相关的问题。
答案 1 :(得分:0)
该解决方案帮助我在ProcFU中实现了此功能。
function create_app_item_with_import_file($id) {
$ret = call_pf_script("podio_item_create.pf",["app_id" => nnnnnnnn,"fields" => json_encode(["title"=>'started']),"hook" => false,"silent" => false]); //create empty item in Imports app
return $ret;
};