APIs & Integrations

WBHydrosense
Participante

Get all note IDs from a specific company ID

resolver

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 Avaliação positiva
2 Solução aceitas
dennisedson
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Get all note IDs from a specific company ID

resolver

@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

Exibir solução no post original

0 Avaliação positiva
WBHydrosense
Solução
Participante

Get all note IDs from a specific company ID

resolver

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

Exibir solução no post original

2 Respostas 2
dennisedson
Solução
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Get all note IDs from a specific company ID

resolver

@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 Avaliação positiva
WBHydrosense
Solução
Participante

Get all note IDs from a specific company ID

resolver

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