mardi 1 octobre 2019

With my curl request I am getting response as ```"{"code":1002,"message":"Required source parameter missing."}"```

When I am trying to hit https://api.kairos.com/v2/media using curl from my api I am getting response as "{"code":1002,"message":"Required source parameter missing."}"


$queryUrl       = "https://api.kairos.com/v2/media";
$videoObject    = [];
$videoObject['source']  =   $request->file('source');
$videoObject['source-filename']  =   $request->input('source-filename');
$data        = curl_init($queryUrl);
   // set curl options
curl_setopt($data, CURLOPT_POST, true);

curl_setopt($data,CURLOPT_POSTFIELDS, json_encode($videoObject));

curl_setopt($data, CURLOPT_HTTPHEADER, array(
                            "Content-type: application/json",
                            "app_id:" . $APP_ID,
                            "app_key:" . $APP_KEY
                        )
                    );
 curl_setopt($data, CURLOPT_RETURNTRANSFER, true);
 $response = curl_exec($data);
 dd($response);

When I tried printing $videoObject, I can see the value of source.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire