Trying to run the job using PHP and REST APIs.
If you run the task through Postman, everything works out.
And if you throw cURL into the terminal, then he also works it out.
Here are the screens with Postman.
But if you insert code with cURL in PHP, formed in Postman, then nothing happens.
Sample code.
Code: Select all
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://192.168.6.24:51088/api/v1/job",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('flowId' => '119','objectId' => '4','jobName' => 'Tettftdst','metadata' => '[{ "id": "spMF_1", "name": "id", "value": "Demon" },{ "id": "spMF_2", "name": "event", "value": "Aly" }]','filePath' => 'agreement_3066556-55218.pdf','file'=> new CURLFILE('/D:/XAMPP/htdocs/Test_php/agreement_3066556-55218.pdf')),
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer e75e59240391326c94ef5274414aa00307e0dff7",
"Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryLXxoX58ScYq3mwdt",
"Cookie: sid=s%3A846636f9619e03ae200fa51b05beb2c882a70119.ebj37CVRwXYnYyPM7LfFw7nM1C0zc1RtJbK5KJap6Yo"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;