Cannot upload file using API via Power Automate

Hi @Jakub_Kadlubiec

Thanks for your response. Definitely not the issue with Power Automate. When I tried via Postman it did worked that’s because Postman abstract a few things like file upload where users can specify whether its a text or file. Pipeline HTTP documentation (Upload file) is very general and doesn’t cover about multi-part form data. I managed to find out and for the further reference someone looking for a solution here it is.

Method: Post
URI: https://hubinternational2.pipedrive.com/api/v1/files
Headers:
{
“Accept”: “application/json”,
“Content-Type”: “multipart/form-data”
}

Queries:
{
“api_token”: “your api token”
}

Body:
{
“$content-type”: “multipart/form-data”,
“$multipart”: [
{
“body”: “your deal id”,
“headers”: {
“Content-Disposition”: “form-data; name="deal_id"”
}
},
{
“body”: {
“$content”: “your binary format of the file content”,
“$content-type”: “application/pdf”
},
“headers”: {
“Content-Disposition”: “form-data; name="file"; filename="yourfilename.pdf"”
}
}
]
}

HTTP action step look like this.

Thanks

1 Like