APIs & Integrations

RRompich
Member

API issue with None associations

SOLVE

Okay, I've been trying to pull emails, tasks, and notes for each of my tickets through the HubSpot API. Basically, I wanted to obtain the association IDs and then call the Engagements API to retrieve that data. I was following this processhttps://community.hubspot.com/t5/APIs-Integrations/Get-all-emails-for-a-ticket/m-p/829716 

 

However, I'm encountering a problem: for all my tickets, the associations section shows a 'None' value. What could be the problem? Could it be a very specific issue with my account?

 

Screenshot 2024-03-31 at 00.41.58.png

 

I am using Python, and this is the offical code provided by HubSpot: 

 

import hubspot
from pprint import pprint
from hubspot.crm.objects import ApiException

client = hubspot.Client.create(access_token="----API----")

try:
api_response = client.crm.objects.basic_api.get_by_id(object_type="tickets", object_id="2545436276", archived=False)
pprint(api_response)
except ApiException as e:
print("Exception when calling basic_api->get_by_id: %s\n" % e)
0 Upvotes
1 Accepted solution
dsmarion
Solution
Top Contributor | Gold Partner
Top Contributor | Gold Partner

API issue with None associations

SOLVE

Try adding the association you want to get back, default is none.  api_response = client.crm.tickets.basic_api.get_by_id(ticket_id="2545436276", associations=["contact"], archived=False)

Scott Marion
Senior Developer @ Thread Connected Marketing

View solution in original post

0 Upvotes
1 Reply 1
dsmarion
Solution
Top Contributor | Gold Partner
Top Contributor | Gold Partner

API issue with None associations

SOLVE

Try adding the association you want to get back, default is none.  api_response = client.crm.tickets.basic_api.get_by_id(ticket_id="2545436276", associations=["contact"], archived=False)

Scott Marion
Senior Developer @ Thread Connected Marketing
0 Upvotes