//File Upload
$cf = new CURLFile($files);
$curl = curl_init(URL);
curl_setopt($curl, CURLOPT_URL, URL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, ['upload' => $cf]);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data =
{
'app': 'faceDetect'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
//Response → {'msg':'Key has been sent to your email'}
//You'll receive a key in in your mail
//Video Link
//Enter the key that you have received in mail
$curl = curl_init(URL/videolink);
curl_setopt($curl, CURLOPT_URL,URL/videolink);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data =
{
'app': 'faceDetect'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
//Response→ {'msg':'Some Random ID'}
//Video RTSP Link
//Enter the key that you have received in mail
$curl = curl_init(URL/link);
curl_setopt($curl, CURLOPT_URL,URL/link);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data =
{
'app': 'faceDetect'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
//Response→ {'msg':'Some Random ID'}
//Video Link for Download
//Enter the key that you have received in mail
//Enter the id that you have received in response while uploading
$curl = curl_init(URL/downloadLink/video);
curl_setopt($curl, CURLOPT_URL,URL/downloadLink/output);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data =
{
'app': 'faceDetect',
'id': '{ID Received}'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
//Response→ {'videoLink':'Video Link for downloading'}
//CSV Link for Download
//Enter the key that you have received in mail
//Enter the id that you have received in response while uploading
$curl = curl_init(URL/downloadLink/output);
curl_setopt($curl, CURLOPT_URL,URL/downloadLink/output);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('key': '********'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data =
{
'app': 'faceDetect',
'id': '{ID Received}'
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($curl);
//Response→ {'fileLink':'CSV Link for downloading'}