APIs & Integrations

JMartínez
Mitglied

Get attachments from a deal not working properly

Hi!
I'm using 2 methods to get the attachments from a deal email. First, I get the associations of a deal, that is working fine and then I use the "Get an engagement" but the attachments array is empty. There is something else to allow the attachments in this method? 

Thanks

2 Antworten
webdew
Ratgeber/-in | Diamond Partner
Ratgeber/-in | Diamond Partner

Get attachments from a deal not working properly

Hi @JMartínez ,


Please fetch each engagement details using this api with engagement ID.

Example GET URL:
https://api.hubapi.com/engagements/v1/engagements/<engagement_ID>?hapikey=demo
You will receive an object representing the requested engagement:
{
"engagement": {
"id": 908,
"portalId": 13565,
"active": true,
"createdAt": 1409172644778,
"lastUpdated": 1409172644778,
"ownerId": 1,
"type": "NOTE",
"timestamp": 1409172644778
},
"associations": {
"contactIds": [
2
],
"companyIds": [],
"dealIds": [],
"ownerIds": []
},
"attachments": [
attachments list when viewing the record in HubSpot
{
"id": 4241968539 // Note this id is file id if you want fetch then use this api https://legacydocs.hubspot.com/docs/methods/files/get_files_file_id
}
],
"metadata": {
"body": "note body"
}
}


Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards. 

0 Upvotes
himanshurauthan
Vordenker/-in | Elite Partner
Vordenker/-in | Elite Partner

Get attachments from a deal not working properly

Hi @JMartínez,

 

Your approach seems to be correct, we have to first find the engagement associations and then have to fetch a single engagement using GET /engagements/v1/engagements/:engagementId


And you don't have to pass any additional detail to get the attachment id in the response.

 

Can you please make sure that you are evaluating the right engagement?

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology