I tried attach audio file to call log but every time receive the same error
{
“error”: “Unsupported Media Type”,
“success”: false,
“error_info”: “Please check developers.pipedrive.com for more information about Pipedrive API.”,
“data”: null,
“additional_data”: null
}
Could somebody provide some example on any language, better PHP.
I use like this
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://test.pipedrive.com/api/v1/callLogs/4e61a611ca1d43d0b02fa69bf6fe6504/recordings',
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('../test3.mp3')),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer MY-TOKEN',
'Content-Type: multipart/form-data; boundary=------' .rand(0, 1000),
'Accept: application/json',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;