# Retrieving call with api

**URL:** <https://community.hubspot.com/t/retrieving-call-with-api/88133>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [August 23, 2023, 1:24pm UTC](https://community.hubspot.com/t/retrieving-call-with-api/88133 "2023-08-23T13:24:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ECamus](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@ECamus](https://community.hubspot.com/u/ECamus)\
**Post date:** [August 23, 2023, 1:24pm UTC](https://community.hubspot.com/t/retrieving-call-with-api/88133/1 "2023-08-23T13:24:48Z")

</div>

Hi, I have a problem while trying to retrieve data from hubspot calls using the api. I understood how to retrieve different properties etc (see my Python code below), but I didn’t quite get how retrieve associations informations (for example the company linked to the call) and especially, how an association type is defined.

```lia-code-sample
from pprint import pprint

import hubspot
from hubspot.crm.objects.calls import ApiException

client = hubspot.Client.create(access_token="token")

try:
 api_response = client.crm.objects.calls.basic_api.get_page(
 limit=1,
 archived=False,
 properties=[
 "hs_timestamp",
 "hs_call_direction",
 "hs_call_duration",
 "hs_call_disposition",
 "hubspot_owner_id",
 "hs_call_body",
 "hs_call_title"
 ],
 )
 pprint(api_response)
except ApiException as e:
 print("Exception when calling basic_api->get_page: %s\n" % e)

```

Thank you for your answers

---

<div class="post-metadata">

**Author:** ![ECamus](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@ECamus](https://community.hubspot.com/u/ECamus)\
**Post date:** [August 23, 2023, 2:22pm UTC](https://community.hubspot.com/t/retrieving-call-with-api/88133/2 "2023-08-23T14:22:02Z")

</div>

Actually, I think I know how to retrieve the associations, but I have a response saying

`'associations' : None`

even if I checked for the corresponding id on hubspot, the call is associated to a company and a contact.

---

<div class="post-metadata">

**Author:** ![coldrickjack](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/coldrickjack/32/6684_2.png) [@coldrickjack](https://community.hubspot.com/u/coldrickjack)\
**Post date:** [August 23, 2023, 2:44pm UTC](https://community.hubspot.com/t/retrieving-call-with-api/88133/3 "2023-08-23T14:44:59Z")

</div>

Hey @ECamus, I’d highly recommend removing the access\_token in your code. This shouldn’t be shared publicly for security reasons.

---

<div class="post-metadata">

**Author:** ![ECamus](https://avatars.discourse-cdn.com/v4/letter/e/8edcca/32.png) [@ECamus](https://community.hubspot.com/u/ECamus)\
**Post date:** [August 23, 2023, 2:48pm UTC](https://community.hubspot.com/t/retrieving-call-with-api/88133/4 "2023-08-23T14:48:15Z")

</div>

You’re right, totally forgot, appreciate it.

---

<div class="post-metadata">

**Author:** ![TibalLoiseleur](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@TibalLoiseleur](https://community.hubspot.com/u/TibalLoiseleur)\
**Post date:** [August 23, 2023, 3:55pm UTC](https://community.hubspot.com/t/retrieving-call-with-api/88133/5 "2023-08-23T15:55:36Z")

</div>

Same problem here, still struggling to figure out how to solve it.  
I will let you know if I find out!
