Fileupload via API with Base64 using Javascript

Hello,

does anyone has experience with converting a Base64 File Attributes to the multipart format that pipedrive requires?

My workflows only allow using Base64 encoding for files and for uploading to my deals in pipedrive they need to be converted.

Any idea is appreciated, thanks!

Answers

  • Sophie
    Sophie Pipedrive Team Posts: 102
    First Comment 5 Likes First Anniversary First Answer
    PIPEDRIVE TEAM

    Hi @whynot,

    I would recommend reaching out to the Pipedrive Developers Community about this, you may receive a more thorough answer to your request there!

    I don't have personal experience with this but from what I have found you can upload a file via Pipedrive's "Add File" POST API here! You'll need to decode the Base64 data and then include it in the multipart request. To do this you can-

    1. Decode the Base64 Data: First, you'll need to decode the Base64-encoded file content. This is usually done in the programming language you are using.
    2. Create a Multipart Request: You then need to create a multipart/form-data request. Most programming languages have libraries to help with this.

    Decoding will depend on which programming language you are using as decoding Base64 data involves using a specific function or method. I hope this helps a bit!