Tickets & Conversations

KrestenOE
Member

Get Contact Vid from Ticket Webhook

SOLVE

When a ticket reaches a certain stage, I use a workflow to fire a webhook which I catch with Zapier. 

 

In the body of the webhook from the workflow, the created_by property does not exist, so I can't get the email of the associated contact from the Contacts API subsequently. If I send a GET to the ticket from Postman with properties=created_by as parameters, I only get the following response:

{
    "objectType": "TICKET",
    "portalId": myPortal,
    "objectId": ticketID,
    "properties": {},
    "isDeleted": false
}

*myPortal & ticketID are the actual values

 

How can this be? I see the associated contact on the ticket just fine in the UI and this property is mandatory when creating the ticket right?

0 Upvotes
1 Accepted solution
Willson
Solution
HubSpot Employee
HubSpot Employee

Get Contact Vid from Ticket Webhook

SOLVE

Hi @KrestenOE 

 

Taking a look into this, I can confirm that the Associated Contact is not a value that is being pulled with this request when defining ticket properties i.e &properties=created_by

 

Instead, I have tested this from my end and have used the Associations Endpoint here:

https://developers.hubspot.com/docs/methods/crm-associations/get-associations

 

If we know the value of the Ticket we're attempting to get the associations for, we can insert the Ticket_id as the associations and as per the association types attached below, we will define the Definition_id as 16 (Ticket to Contact):
https://developers.hubspot.com/docs/methods/crm-associations/crm-associations-overview

 

This gives us the following request:

https://api.hubapi.com/crm-associations/v1/associations/TICKET_ID/HUBSPOT_DEFINED/16?hapikey=xxxxxx

Giving us a response of:

{
    "results": [
        10001
    ],
    "hasMore": false,
    "offset": 10001
}

The results here listing the contact_vid(s). 


Let me know if you have any questions here.

 

Thanks,

Matt

Product Manager @ HubSpot

View solution in original post

1 Reply 1
Willson
Solution
HubSpot Employee
HubSpot Employee

Get Contact Vid from Ticket Webhook

SOLVE

Hi @KrestenOE 

 

Taking a look into this, I can confirm that the Associated Contact is not a value that is being pulled with this request when defining ticket properties i.e &properties=created_by

 

Instead, I have tested this from my end and have used the Associations Endpoint here:

https://developers.hubspot.com/docs/methods/crm-associations/get-associations

 

If we know the value of the Ticket we're attempting to get the associations for, we can insert the Ticket_id as the associations and as per the association types attached below, we will define the Definition_id as 16 (Ticket to Contact):
https://developers.hubspot.com/docs/methods/crm-associations/crm-associations-overview

 

This gives us the following request:

https://api.hubapi.com/crm-associations/v1/associations/TICKET_ID/HUBSPOT_DEFINED/16?hapikey=xxxxxx

Giving us a response of:

{
    "results": [
        10001
    ],
    "hasMore": false,
    "offset": 10001
}

The results here listing the contact_vid(s). 


Let me know if you have any questions here.

 

Thanks,

Matt

Product Manager @ HubSpot