APIs & Integrations

mseibert
Contributor

Cannot retrieve engagements for a contact via API

SOLVE

I would like to retrieve all or at least the most recent engagements for a contact. I have read this docs page: https://legacydocs.hubspot.com/docs/methods/crm-associations/get-associations

 

But both for the sample call but also for a specific call with my contact ID 76759 the :definitionId of 10 and our real HubSpot API key I always get a JSON with an empty result (Status: 200 OK)

https://api.hubapi.com/crm-associations/v1/associations/25/HUBSPOT_DEFINED/15?hapikey=demo
{"results":[],"hasMore":false,"offset":0}

 

1 Accepted solution
mseibert
Solution
Contributor

Cannot retrieve engagements for a contact via API

SOLVE
I used a deprecated ID that changed after a contact merge. Sorry for the fuzz. 🤐

View solution in original post

6 Replies 6
mseibert
Solution
Contributor

Cannot retrieve engagements for a contact via API

SOLVE
I used a deprecated ID that changed after a contact merge. Sorry for the fuzz. 🤐
himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Cannot retrieve engagements for a contact via API

SOLVE

That's great. 🙂

Digital Marketing & Inbound Expert In Growth Hacking Technology
mseibert
Contributor

Cannot retrieve engagements for a contact via API

SOLVE

No matter what I am using, the results work but remain empty although there is data to be retrieved. #hmpf

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Cannot retrieve engagements for a contact via API

SOLVE

@mseibert 

I believe you will want to use 9 rather than 10 for the association definition.

Have you tested with other contacts to see if it is isolated to this record?

0 Upvotes
himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Cannot retrieve engagements for a contact via API

SOLVE

Hi @mseibert,

 

You have to change few values in the URL, like -

 

https://api.hubapi.com/crm-associations/v1/associations/76759/HUBSPOT_DEFINED/10?hapikey={your_api_key}

 

You can get the definition ids from here: https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
mseibert
Contributor

Cannot retrieve engagements for a contact via API

SOLVE

Hm. I keep getting empty results:

{ results: [], hasMore: false, offset: 0 }

The hapikey must be correct, as I am getting a status code 200 and errors with a different code. I am confused. Every note should be an engagement, right. Or what will be listed here?

 

0 Upvotes