We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Mar 30, 2022 11:27 AM
Hello,
Was hoping someone could lend a hand - I am looking to fetch a list of all NOTE engagement IDs of a specified company ID.
I have this working to retrieve emails but just struggling to get notes.
Currently, I am using a combination the legacy and V3 to achieve this with emails;
I query with the following link
https://api.hubapi.com/crmassociations/v1/associations/{COMPANYID}/HUBSPOT_DEFINED/7
This retrieves all engagement ids for specified company ID
I then use a V3 API to retrieve the email body of the specified engagement id
https://api.hubapi.com/crm/v3/objects/emails/{ENGAGMENT ID}?properties=hs_email_text&archived=false&hapikey=XXXX
Any help on achieving what I have with emails for NOTES would be massively appreciated - also open to any suggestions on how to improve my current process for emails
Thank you very much in advance
Will
Solved! Go to Solution.
Mar 31, 2022 12:31 PM
You could use the "Read a batch of association" on the Associations API
Or, you could go crazy and use the Associations Beta API
With V3, you would make a post request like this:
https://api.hubapi.com/crm/v3/associations/companies/notes/batch/read
and a json body like this:
{
"inputs": [
{
"id": "ID OF COMPANY HERE"
}
]
}
Using the V4 endpoint:
https://api.hubapi.com/crm/v4/objects/companies/COMPANYID/associations/notes
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |
Apr 1, 2022 6:19 AM
Absolute Genius! Thank you very much Dennis!
Decided to take a slightly different approach in the end
I used the below call to loop through and query all engagements for a specific company ID and then filtered by engagement type to 'notes, emails meetings, tasks'
https://api.hubapi.com/engagements/v1/engagements/associated/COMPANY/{COMPANY ID}/paged
Thanks again!
Will
Mar 31, 2022 12:31 PM
You could use the "Read a batch of association" on the Associations API
Or, you could go crazy and use the Associations Beta API
With V3, you would make a post request like this:
https://api.hubapi.com/crm/v3/associations/companies/notes/batch/read
and a json body like this:
{
"inputs": [
{
"id": "ID OF COMPANY HERE"
}
]
}
Using the V4 endpoint:
https://api.hubapi.com/crm/v4/objects/companies/COMPANYID/associations/notes
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |
Apr 1, 2022 6:19 AM
Absolute Genius! Thank you very much Dennis!
Decided to take a slightly different approach in the end
I used the below call to loop through and query all engagements for a specific company ID and then filtered by engagement type to 'notes, emails meetings, tasks'
https://api.hubapi.com/engagements/v1/engagements/associated/COMPANY/{COMPANY ID}/paged
Thanks again!
Will