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?
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?
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?