# Cannot retrieve engagements for a contact via API

**URL:** <https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, events\
**Created:** [May 23, 2021, 1:12pm UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778 "2021-05-23T13:12:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mseibert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mseibert/32/82797_2.png) [@mseibert](https://community.hubspot.com/u/mseibert)\
**Post date:** [May 23, 2021, 1:12pm UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778/1 "2021-05-23T13:12:33Z")

</div>

I would like to retrieve all or at least the most recent engagements for a contact. I have read this docs page: [Accounts Dashboard | HubSpot](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}`

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [May 24, 2021, 9:41am UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778/2 "2021-05-24T09:41:18Z")

</div>

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: [Accounts Dashboard | HubSpot](https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview)

Regards,

---

<div class="post-metadata">

**Author:** ![mseibert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mseibert/32/82797_2.png) [@mseibert](https://community.hubspot.com/u/mseibert)\
**Post date:** [May 24, 2021, 10:37am UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778/3 "2021-05-24T10:37:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mseibert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mseibert/32/82797_2.png) [@mseibert](https://community.hubspot.com/u/mseibert)\
**Post date:** [May 24, 2021, 10:51am UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778/4 "2021-05-24T10:51:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [May 24, 2021, 1:27pm UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778/5 "2021-05-24T13:27:04Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![mseibert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mseibert/32/82797_2.png) [@mseibert](https://community.hubspot.com/u/mseibert)\
**Post date:** [May 24, 2021, 7:35pm UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778/6 "2021-05-24T19:35:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [May 25, 2021, 4:11am UTC](https://community.hubspot.com/t/cannot-retrieve-engagements-for-a-contact-via-api/37778/7 "2021-05-25T04:11:49Z")

</div>

That’s great. 🙂
