Retrieving call with api

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.

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

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.

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

You’re right, totally forgot, appreciate it.

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