Get attachment from deal ID

deals

#1

Hi,

Is there a way to get the attachment file IDs from a deal with the API?

Thanks!
David


#2

Hmm just replying to myself :smiley:

So I suppose that I need to use the “get_associated_engagements” endpoint:

Filtering with the DEAL type + the deal ID.
Do you think that there would be a way to filter only engagements with a type that would be like “ATTACHMENT”

Thanks!
David


#3

Hello

I’ve just found this old question.
I have pretty the same question.
Is it possible to get list of attachments from DEAL ID?

For now I do it like this:
Get all engagements using


and after check if each engagement has attachments
and if has one or more, I do request for getting attachment info

But it is not really good way. I should do a lot of request.

Probably there will be some new API method for getting attachment list from DEAL (CONTACT, COMPANY) ID.
It will be great.

Thanks.


#4

Hi @kremenetskyi,

All attachments to objects (deals, contacts, companies, etc.) are actually just note engagements with an included file. Pulling the associated engagements is currently the only way to get attached files. I can understand the use case you’re mentioning, though. If you have the inclination, I would encourage you to check out the Ideas Forum on the HubSpot Community. There, you can create a post including your use case that product and other customers can see.


#5

Hello,

is this still the case? the only reason I ask is I'm trying to access all the documents within a deal. Using the current method I have to get all of the engagements for a deal, then loop around those to get the attachment id, then make a separate call to get each document.

On top of this, if there are 100 records in the first engagement call, I have to make another call shifting the offset to get more engagements, then do the above all over again.

Surely there is a get /files/v1/files/associated/deal/[id]/paged?hapikey=happydays

type thing?

Thanks!