# Read Associations v4 Python AttributeError: 'BasicApi' object has no attribute 'get\_crm\_v4\_objects\_o

**URL:** <https://community.hubspot.com/t/read-associations-v4-python-attributeerror-basicapi-object-has-no-attribute-get-crm-v4-objects-o/91321>\
**Category:** APIs & Integrations\
**Tags:** python, object, contacts\
**Created:** [October 6, 2023, 7:49pm UTC](https://community.hubspot.com/t/read-associations-v4-python-attributeerror-basicapi-object-has-no-attribute-get-crm-v4-objects-o/91321 "2023-10-06T19:49:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PIntegration](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@PIntegration](https://community.hubspot.com/u/PIntegration)\
**Post date:** [October 6, 2023, 7:49pm UTC](https://community.hubspot.com/t/read-associations-v4-python-attributeerror-basicapi-object-has-no-attribute-get-crm-v4-objects-o/91321/1 "2023-10-06T19:49:44Z")

</div>

Hi!

I need to read the association beetwing deals and contacts using Associations v4.  
I copy the code in [CRM API | Associations v4 (hubspot.com)](https://developers.hubspot.com/docs/api/crm/associations)

 ![PIntegration_0-1696621472876.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/f/5fd6f2023ad00ed91dfe7e60a86a7d002bae692b.png)

This code work running on [hubspot.com](http://hubspot.com). But when I run localy I received this error:  
Cell In[65], line 2 1 try: ----\> 2 api\_response = client.crm.associations.v4.basic\_api.get\_crm\_v4\_objects\_object\_type\_object\_id\_associations\_to\_object\_type(object\_type=“0-3”, object\_id=8242381931, to\_object\_type=“0-1”, limit=500) 3 pprint(api\_response) 4 except ApiException as e:

AttributeError: ‘BasicApi’ object has no attribute ‘get\_crm\_v4\_objects\_object\_type\_object\_id\_associations\_to\_object\_type’

I don’t understand if I need to install something else.  
Could you please help me?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![zachh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zachh/32/87065_2.png) [@zachh](https://community.hubspot.com/u/zachh)\
**Post date:** [October 9, 2023, 3:17pm UTC](https://community.hubspot.com/t/read-associations-v4-python-attributeerror-basicapi-object-has-no-attribute-get-crm-v4-objects-o/91321/2 "2023-10-09T15:17:09Z")

</div>

Hi @PIntegration

Have you set up your local environment with [Hubspot’s Python libraries](https://developers.hubspot.com/docs/api/client-libraries)?

I also see your object types say “0-3” and “0-1” when you likely want “deals” and “contacts” respectively.

If neither of those work, it might help to see what your edited code looks like (with your API key redacted of course).

- Zach

---

<div class="post-metadata">

**Author:** ![PIntegration](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@PIntegration](https://community.hubspot.com/u/PIntegration)\
**Post date:** [October 9, 2023, 6:12pm UTC](https://community.hubspot.com/t/read-associations-v4-python-attributeerror-basicapi-object-has-no-attribute-get-crm-v4-objects-o/91321/3 "2023-10-09T18:12:21Z")

</div>

Hi Zach,

Thanks for answer.

I’m working on Azure. I installed the pack at the begining. This is my code

 ![PIntegration_1-1696875087502.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/6/c61527c174066fbbce0b515a9a979dadcf0bd3ba.png)

---

<div class="post-metadata">

**Author:** ![zachh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zachh/32/87065_2.png) [@zachh](https://community.hubspot.com/u/zachh)\
**Post date:** [October 16, 2023, 1:52pm UTC](https://community.hubspot.com/t/read-associations-v4-python-attributeerror-basicapi-object-has-no-attribute-get-crm-v4-objects-o/91321/4 "2023-10-16T13:52:52Z")

</div>

Hi @PIntegration

It looks like you have the default values for “id” and “after” from the API page.

![zachh_0-1697464082536.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/a/4ae3738b0ec428e3981440ff2eb03c59e74687b4.png)

Since you’re trying to pull a deal’s contact associations, the “id” string should be replaced with **the record ID of the deal** you want to check. The “after” field is not required, so you can remove it so it’s not looking for a value of “string.”

This part should look more like this:  
_BatchInputPublicFetchAssociationsBatchRequest(inputs=[{“id”:“12345”}])_

Can you try making these changes and seeing if that fixes anything?

- Zach
