Attache audio file to call log don't work

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;

Hello, @Aleksandr_Malakhov and welcome to the community! :wave:

I have forwarded your question to our engineering team and I’ll get back to you!

Sincerely,
Helena

Hey, @Aleksandr_Malakhov :wave:

An example cURL request looks like this:

curl 'https://doorman.pipedrive.tools/proxy/sales-phone-api//v1/callLogs/CA00612c7919d42e0f420081d11159b561/recordings' \
 -X POST \
 -F 'file=@file_example_MP3_700KB.mp3;type=audio/mp3' \
... authentication here ...

Here’s another resource that you could check out: PHP upload file with curl (multipart/form-data) · GitHub

Let us know if you were able to fix it!
Sincerely,
Helena