Ben Mannino
Ben Mannino

Reputation: 313

Handling file attachments from Pipedrive to Trello API

I have been working with the Pipedrive and Trello APIs for the past week, and everything seems to be working fine. I'm writing scripts using classic ASP to handle notifications from Pipedrive to create new cards on our company Trello board.

I am trying to figure out the best way to handle files attached to a deal in Pipedrive. The main notification sends me the number of attached files, which I can then use to call the API again and request the specific file info.

I believe Pipedrive is using S3 to store the files, so I was hoping to get a simple URL I could then transfer to the Trello card. I do get a file URL and file name from the API call, but a quick test of that URL in a web browser results in a JSON response saying that there is no active session. I cannot find any API documentation on how to handle these files.

Any ideas on the easiest way to access these files from Pipedrive on the Trello cards?

Thanks, -Ben

Upvotes: 1

Views: 917

Answers (1)

Matt
Matt

Reputation: 584

After you obtain the file ID, did you try something like this: app.pipedrive.com/api/v1/files/1/download?api_token=TOKEN?

When testing this I had luck fetching a file attached to a Pipedrive deal using PHP. Example:

header("Content-type: image/gif");
$image = file_get_contents("http://app.pipedrive.com/api/v1/files/1/download?api_token=TOKEN");
echo $image;

Upvotes: 1

Related Questions