I would like to test a very simple case with the API CloudConvert with a curl request. I want to import the file essaiFichier.txt with a curl request. I get a response in Json with a status "waiting". I have no idea if the request was well done. If someone has faced the same problem it would be great to have some Below my code in order to fix the issue.
$authorization ="Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOi";
$url ="https://api.cloudconvert.com/v2/jobs";
$post = '{
"tasks": {
"import-1": {
"operation": "import/url",
"url": "http://localhost/biere/essaiFichier.txt",
"filename": "essaiFichier.txt"
}
}
}';
$ch=curl_init($url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$info = curl_getinfo($ch);