-1

I need to create an item in Podio using procfu, like this:

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

but the script returns error:

ERROR: PodioBadRequestError: "Invalid value null (null): must be non null"

Mûhámmàd Yäsår K
  • 1,492
  • 11
  • 24
Andreea Onica
  • 315
  • 5
  • 13

2 Answers2

0

This is the solution , if anyone needs it :

curl_setopt($ch, CURLOPT_POSTFIELDS, HTTP_BUILD_QUERY(["app_id"=>"********","fields" => json_encode(["title"=>'tst'])]));

I don't understand why the question was downvoted, it is a very relevant question.

Andreea Onica
  • 315
  • 5
  • 13
0

the solution helped me with this function in 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;

};

R Siegmund
  • 13
  • 3