I am using Python to extract the data from HubSpot with the Private App API calls. I am using the Ticket and Contacts to load into dataframes within my python environment.
Tickets give me these key attributes:
archived
archived_at
associations
created_at
id
content
createdate
hs_lastmodifieddate
hs_object_id
hs_pipeline
hs_pipeline_stage
hs_ticket_category
hs_ticket_priority
subject
properties_with_history
updated_at
Contact gives me these key attributes:
archived
archived_at
associations
created_at
id
createdate
email
firstname
hs_object_id
lastmodifieddate
lastname
properties_with_history
updated_at
I am trying to match each ticket created to the contact but there isn't a key attribute in both data frames for me to match. Is this because of the Private Apps and what scopes I am picking or is there something else going on? Any and all help will be much appreciated.
Feb 5, 202311:58 AM - edited Feb 5, 202311:59 AM
Contributor
Matching Ticket to Contact
You should use the Associations API where you specify which object types (Contact and Ticket) you look for, and specific id of one of them (for instance, the contactId you want all connected Tickets for). In javascript/node.js the Hubspot client really simplifies things, so maybe the Python one does it as well.
My API/dev knowlegde is rudimentary, but I know HubSpot works with hs_object_id to identify individual records, and then associations to link objects together.
I would expect that the associations attribute in the ticket object contains a reference to a hs_object_id on a contact. This article seems to confirm my assumption.
I hope that helps.
Frank
Found my comment helpful? Great! Please mark it as a solution to help other community users.
Each object in HubSpot (contact, company, deal, ticket, etc.) has a hs_object_id
Each object in HubSpot is associated to one or more other HubSpot objects, check out https://app.hubspot.com/data-model-overview/HubID/ for an interactive overview. The ticket object can be associated with companies, contacts and deals with a 1-to-many relationship, i.e. 1 ticket is associated with 2 contacts.
This would mean, that the ticket in question would show 2 hs_contact_ids under the ticket association.
Similarly, if a contact has multiple tickets (pretty common scenario) you would be able to query the associated ticket objects which would return a series of hs_object_ids for tickets.
Does that make sense?
Frank
Found my comment helpful? Great! Please mark it as a solution to help other community users.
The link you provided, unfortunately, didn't work, but when I tried to match the Hubspot object ID in tickets to the HubSpot in Contacts, nothing matched.
What I am finding is that the Contact object_id is no longer than 6 characters whereas the HubSpot object_id in the ticket is 10 characters long.
Their object_id's do not match in length.
As well, with my company's tickets, there is an option to fill an area called affiliate_code but this does not show in the ticket information. Is there a way to change this or get all the information from the ticket even if it's blank?