$path = storage_path($file);
$ch = curl_init();
$authorization = "Authorization: Zoho-oauthtoken ".$this->access_token;
$contentType = "Content-Type: multipart/form-data; boundary=<calculated when request is sent>";
curl_setopt($ch, CURLOPT_HTTPHEADER, [$authorization,$contentType]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'data' => json_encode([
'requests' => [
'request_name' => "NDA ",
'actions' => $this->actions,
'is_sequential' => false,
]
]),
'file' => curl_file_create($path)
]);
$output = curl_exec($ch);