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.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]