APIs & Integrations

WBHydrosense
Participant

Get all note IDs from a specific company ID

Résolue

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

0 Votes
2 Solutions acceptées
dennisedson
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Get all note IDs from a specific company ID

Résolue

@WBHydrosense 

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

Voir la solution dans l'envoi d'origine

0 Votes
WBHydrosense
Solution
Participant

Get all note IDs from a specific company ID

Résolue

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

Voir la solution dans l'envoi d'origine

2 Réponses
dennisedson
Solution
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Get all note IDs from a specific company ID

Résolue

@WBHydrosense 

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

0 Votes
WBHydrosense
Solution
Participant

Get all note IDs from a specific company ID

Résolue

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