APIs & Integrations

SLABONNE
Participant

Download deal attachment files with API request in Zapier

SOLVE

Hi,

 

I'm trying to get all attachments files from a Hubspot deal within Zapier.

 

Following other posts, I managed to use Get Associations for a deal : 

https://legacydocs.hubspot.com/docs/methods/crm-associations/get-associations

 

However the IDs returned do not match anything. When trying to use Get File Metadata or Get An Engagement, Zapier is failing to create a request.

 

Am I missing a step?

 

Thank you,  

0 Upvotes
1 Accepted solution
MatthiasKunz
Solution
Participant | Partner
Participant | Partner

Download deal attachment files with API request in Zapier

SOLVE

Hello @Jaycee_Lewis and @SLABONNE 

this is not going to be straightforward at all unfortunately. First of all, please note the API documentation you have been looking at is legacy, you should definitely look at this one: https://developers.hubspot.com/docs/api/overview 

That being said, independent of the API version, files are not simply associations of a deal, so that approach would not work. Files are attached to engagements, which in turn may be attached to a deal. The field in the UI that shows attachments essentially sums up the attachments from all engagements on the current object. The associations endpoint looks at associations between contacts, deals, companies etc. or between these and engagements. 

So you would essentially have to find the engagements on your deal (making a few calls to get the different types) and then try to download the file attached to these. The latter step I admit I have never tried before, but that would be the approach to take in my view.

I am not sure why the get an engagement call is not working for you, it should in principle but you would have to share what the call looks like, that you are trying to make.

Maybe there is a different way to help achieve your use-case. What are you trying to achieve more generally?

View solution in original post

3 Replies 3
DMitchell5
Member

Download deal attachment files with API request in Zapier

SOLVE

Hi @SLABONNE , did you manage to find a solution to this? 

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Download deal attachment files with API request in Zapier

SOLVE

Hi, @SLABONNE 👋 Thanks for reaching out. Let's invite some of our community members to the conversation — hey @MatthiasKunz @ChrisoKlepke @ChristinaKay, do you have any Zapier-related tips you can share with @SLABONNE? Or suggestions on how they might tackle this project while using Zapier?

 

Thank you very much! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
MatthiasKunz
Solution
Participant | Partner
Participant | Partner

Download deal attachment files with API request in Zapier

SOLVE

Hello @Jaycee_Lewis and @SLABONNE 

this is not going to be straightforward at all unfortunately. First of all, please note the API documentation you have been looking at is legacy, you should definitely look at this one: https://developers.hubspot.com/docs/api/overview 

That being said, independent of the API version, files are not simply associations of a deal, so that approach would not work. Files are attached to engagements, which in turn may be attached to a deal. The field in the UI that shows attachments essentially sums up the attachments from all engagements on the current object. The associations endpoint looks at associations between contacts, deals, companies etc. or between these and engagements. 

So you would essentially have to find the engagements on your deal (making a few calls to get the different types) and then try to download the file attached to these. The latter step I admit I have never tried before, but that would be the approach to take in my view.

I am not sure why the get an engagement call is not working for you, it should in principle but you would have to share what the call looks like, that you are trying to make.

Maybe there is a different way to help achieve your use-case. What are you trying to achieve more generally?