# Associations API Get All Returns Blank (Python)

**URL:** <https://community.hubspot.com/t/associations-api-get-all-returns-blank-python/71756>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [December 22, 2022, 8:26pm UTC](https://community.hubspot.com/t/associations-api-get-all-returns-blank-python/71756 "2022-12-22T20:26:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SJarvis6](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@SJarvis6](https://community.hubspot.com/u/SJarvis6)\
**Post date:** [December 22, 2022, 8:26pm UTC](https://community.hubspot.com/t/associations-api-get-all-returns-blank-python/71756/1 "2022-12-22T20:26:13Z")

</div>

Hello,

In the last week or two my calls to list company associations on a deal stopped working for v3. On deals that I know have a company associated, the API returns no records. Am I calling the API incorrectly or is something else up? I copied the code directly from the API endpoint docs so I’m not sure what else to do here.

This is the code I’m using:

import hubspot

from pprint import pprint

from hubspot.crm.deals import ApiException

myAccessToken = “MyAccessToken”

dealId = 11426070894

client = hubspot.Client.create(access\_token=

myAccessToken )

try:

api\_response = client.crm.deals.associations\_api.get\_all(deal\_id=dealId

, to\_object\_type=“companies”, limit=500)

pprint(api\_response)

except ApiException as e:

print(“Exception when calling associations\_api-\>get\_all: %s\n” % e)

Syrus

---

<div class="post-metadata">

**Author:** ![ChrisoKlepke](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrisoklepke/32/11213_2.png) [@ChrisoKlepke](https://community.hubspot.com/u/ChrisoKlepke)\
**Post date:** [December 23, 2022, 9:23am UTC](https://community.hubspot.com/t/associations-api-get-all-returns-blank-python/71756/2 "2022-12-23T09:23:08Z")

</div>

Hey @SJarvis6 ,

that is very odd- I’ve tested the code, and it worked fine for me. Can you tell us what error message you’re getting, or is the request just getting through?

Cheers,

Chriso

---

<div class="post-metadata">

**Author:** ![SJarvis6](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@SJarvis6](https://community.hubspot.com/u/SJarvis6)\
**Post date:** [December 23, 2022, 3:13pm UTC](https://community.hubspot.com/t/associations-api-get-all-returns-blank-python/71756/3 "2022-12-23T15:13:40Z")

</div>

Hey @ChrisoKlepke ,

The request goes through fine and this is the API reponse i recieve back:

{‘paging’: None, ‘results’: [{‘id’: None, ‘type’: None}]}

When I search the Deal ID with the deals get\_by\_id call, I see the association there but it’s more convienent if I can use the associations call.

Syrus

---

<div class="post-metadata">

**Author:** ![SJarvis6](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@SJarvis6](https://community.hubspot.com/u/SJarvis6)\
**Post date:** [January 17, 2023, 5:15pm UTC](https://community.hubspot.com/t/associations-api-get-all-returns-blank-python/71756/4 "2023-01-17T17:15:00Z")

</div>

Hey @ChrisoKlepke ,

Wondering if you have any new insight to this. One thing i did notice is that the get\_deal\_by\_id call returns two associations for the same company, picture below:

 ![SJarvis6_0-1673975585967.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/a/2a426de68e14c7e1995598d60b7582effdaee959.png)

and the associations call returns: {‘id’: None, ‘type’: None}

Not sure if this sheds any more light on the issue. But it is still occuring and causing me a headache.

Thanks,

Syrus
