# RESOLVED

**URL:** <https://community.hubspot.com/t/resolved/97044>\
**Category:** APIs & Integrations\
**Created:** [January 3, 2024, 8:04pm UTC](https://community.hubspot.com/t/resolved/97044 "2024-01-03T20:04:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SJohnson0](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@SJohnson0](https://community.hubspot.com/u/SJohnson0)\
**Post date:** [January 3, 2024, 8:04pm UTC](https://community.hubspot.com/t/resolved/97044/1 "2024-01-03T20:04:36Z")

</div>

const associationsResponse = await hubspotClient.crm.associations.getApiAssociations(0, contactId, 2);

i keep getting the errow ’ Property ‘getApiAssociations’ does not exist on type ‘AssociationsDiscovery’.’

what is the correct way to retive associates based on contactId

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [January 11, 2024, 4:49am UTC](https://community.hubspot.com/t/resolved/97044/2 "2024-01-11T04:49:41Z")

</div>

Hi @SJohnson0 👋

You might consider using the [HubSpot CRM “Read Contact” endpoint](https://developers.hubspot.com/docs/api/crm/contacts). The documentation gives the following example where Node is the client library in play:

```lia-code-sample
const hubspot = require('@hubspot/api-client');

const hubspotClient = new hubspot.Client({"accessToken":"YOUR_ACCESS_TOKEN"});

const contactId = "12345"; // replace with the relevant contact id
const properties = undefined;
const propertiesWithHistory = undefined;
const associations = [
 "companies,deals" // comma-separated list of target associated object-types
];
const archived = false;

try {
 const apiResponse = await hubspotClient.crm.contacts.basicApi.getById(contactId, properties, propertiesWithHistory, associations, archived);
 console.log(JSON.stringify(apiResponse, null, 2));
} catch (e) {
 e.message === 'HTTP request failed'
 ? console.error(JSON.stringify(e.response, null, 2))
 : console.error(e)
}

```

I hope this proves useful. Please let me know if you have any follow-up questions.
