Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By rohan0793
#793287
Hi,

I am trying to work with the API to import a process in to process maker.

http://wiki.processmaker.com/3.2/REST_A ... ortProject

I passed the project_file variable as the path of the file but it gives me error saying that the file doesn't exist. But when I pass the same path in file_exist method, it returns true. Is that API endpoint functional? And if yes, how to use it?

Best,
User avatar
By amosbatto
#793298
Are you using PHP? If so, then this code example won't work in PHP 5.5 and later:
Code: Select all
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
         "project_file" => "@" . "/path_to_pmx_file/" . $filename
));
Instead you need to use this code:
Code: Select all
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
         "project_file" => new CurlFile("/path_to_pmx_file/" . $filename)
));
If you are trying to use JavaScript, then forget about it, because the language doesn't allow the uploading of files.
By rohan0793
#793310
But I am using Guzzle for this. Do you have any idea how to do this with guzzle? I also tried to use postman, both by attaching a file and also by inputting the file path but no luck.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]