I cannot add the call log recording to pipedrive via python requests, while I can normally do this via Postman.
what I am trying is
url = "https://api.pipedrive.com/v1/callLogs/jjjj/recordings?api_token=some_code"
payload = {}
files=[
('file',('LOCAL_FILE_20230726024715481.mp3','rb',
open('LOCAL_FILE_20230726024715481.mp3','rb'),'audio/mpeg'))
]
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
I have also tried not adding some of the headers, or loading the files in another way (say, without ‘file’ key and/ or only file binary inhold but not the filename).
I do not know how to add the info on the multipart-form file size to the request (or how to calculate it).
I am running into code 400 or this error:
content-type header: multipart missing boundary",“success”:false,“error_info”:“Please check developers.pipedrive.com for more information about Pipedrive API.”
the issue is apparently linked to this,
but I am on python and some things should be a little bit simpler here
the chunk itself is taken from Postman which is renowned for being able to generate normal code for runtimes.
I have also tried some suggested by chatgpt4 and on SO.
Pipedrive API Support was unhelpful and directed me to the community (How to add call audio recording with python requests /callLogs/<id>/recordings — Pipedrive Community), whence I got another chatgpt4 response which is incorrect, and now I am here.
So please kindly do not provide one more chatgpt4-generated response.
Thank you in advance for help in any advancement on this matter.