# Retrieving associations between Object A and Object B

**URL:** <https://community.hubspot.com/t/retrieving-associations-between-object-a-and-object-b/75726>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [February 22, 2023, 11:55am UTC](https://community.hubspot.com/t/retrieving-associations-between-object-a-and-object-b/75726 "2023-02-22T11:55:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![avoiculescu](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@avoiculescu](https://community.hubspot.com/u/avoiculescu)\
**Post date:** [February 22, 2023, 11:55am UTC](https://community.hubspot.com/t/retrieving-associations-between-object-a-and-object-b/75726/1 "2023-02-22T11:55:21Z")

</div>

Hello,

Please help me elucidate my confusion when retrieving the associations between 2 objects (A and B).

Let’s suppose

A = contact and B = company

RecA = 123 (this is a contact id)

RecB = 789 (this is a company id)

Using the following 2 endpoints for retrieval:

[1. https://api.hubspot.com/crm/v4/objects/contact/123?associations=company](https://api.hubspot.com/crm/v4/objects/contact/123?associations=company)

AND

[2. https://api.hubspot.com/crm/v4/objects/company/789?associations=company](https://api.hubspot.com/crm/v4/objects/company/789?associations=company)

I obtain the following:

1. 

“associations”: {

“companies”: {

“results”: [

{

“id”: “789”,

“type”: “contact\_to\_company”

},

{

“id”: “789”,

“type”: “contact\_to\_company\_unlabeled”

}

]

}

}

1. 

“associations”: {

“contacts”: {

“results”: [

{

“id”: “123”,

“type”: “company\_to\_contact”

},

{

“id”: “123”,

“type”: “company\_to\_contact\_unlabeled”

}

]

}

}

What I understand is that I receive the same set of associations everytime I retrieve them from the perspective of both object A and object B (regardless the object type: contact, company, customobject..)

So if I want to persist them in a storage I would have a sort of duplicate associations.

Am I thinking on the right direction or is there any other aspect which is not coverd in the documentation?

I appreciate any help and please redirect me if this is a duplicate post.

Regards,

Andrei
