When I'm trying to upload a file using creator api that time I'm getting authentication error, but when I have tried to create new records within creator using api that time record creating successfully and the authentication error is not showing. Please guide me how can I resolve this. I'm sharing my code below.
$file_path = get_stylesheet_directory_uri()."/assets/sample_images/sherry.jpg";
$curl = curl_init();
curl_setopt_array($curl, array(
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('file'=> new CURLFILE($file_path)),
CURLOPT_HTTPHEADER => array(
'Authorization: Zoho-oauthtoken 1000.2---------------------'
),
));
echo "<br>";
echo "<br>";
$response = curl_exec($curl);
curl_close($curl);
echo $response;