HubSpot & Zapier: add labels to chats in TimelinesAI depending on who is the owner of the contact at HubSpot
via Zapier
This workflow labels chats in TimelinesAI depending on who is the owner of the contact at HubSpot when new WhatsApp message is sent or received.
Create a new Zap at Zapier.com
Trigger :
app: search for and select TimelineAI
event: select New Sent Message or New Received Message depending on when you would like to start labeling chats at TimelinesAI. To track both events - create 2 separate zaps.
Account: choose your connection. If you don't have any connections, establish the connection with your TimelinesAI workspace by entering your token from https://app.timelines.ai/integrations/zapier/
Test the trigger. Depending on the event, wait for the new WA message to be received or send a new WA message yourself. Further steps require data from the trigger to be present. Make sure you've run this module and have data in the payload
Step #1: add a new step after the Trigger by clicking the + sign.
app: search for and select HubSpot
event: select Find Contact
account: choose your connection. If you don't have any connections, establish the connection by following on-screen instructions in Zapier.
First search property name: select Contact Information: Phone Number
First search property value: insert Recipient Phone Number from payload if you are triggering the flow by New Sent Message event. Insert Sender Phone if you are triggering the flow by New Received Message event.
Additional properties to retrieve : select Sales Properties: Contact Owner
Leave other fields as is and make sure to test the step and have output results in the payload.
Condition: add a new step after Find Contact module . Select "Filter" under the "Built-in" tools section
Only continue if…: select the ID from Find Contact module
Condition : select Exists
Path: add a new step after the filter: Select "Path" under the under the "Built-in" tools section
Path A- Path Rules:
Only continue if: select Sales Properties: Contact Owner
Condition: Text exactly matches
Value: enter the user ID of your team member at HubSpot. To find IDs of your team members at HubSpot follow steps from this HubSpot thread
Path A- step #1: add a new step after the path rule. Select "Format" under the "Built-in" tools section
Event: select Text
Transform: select Replace
Value: insert Sales Properties: Contact owner from the Fina Contact module
Find: type the user ID of your team member at HubSpot. To find IDs of your team members at HubSpot follow steps from this HubSpot thread
Replace : type the actual name of the team member associated with the ID. The name added at this step will be added as chat label at TimelinesAI
Leave other fields as is and make sure to test the step and have output results in the payload.
Path A- step#2: add a new step after the Format module. Search for and select "Webhooks by Zapier".
Event: select Custom Request
Method: select PUT
URL: add https://app.timelines.ai/integrations/api/chats/XXXX/labels . Where XXX is to be replaced by the chatID value from the payload ( passed by trigger)
Data Pass-Through?: select False
Data: add below, where XXXX is to be replaced by the output value for Format module
Unflatten: select Yes
Headers: add 2 headers. Authorization Bearer XXX and Content-Type application/json . The XXX in Authorization header is to be replaced by your own token from https://app.timelines.ai/integrations/api/
Save your changes.
Under Path B, Path C repeat steps 8-11 to create separate labels associated with each team member at HubSpot.
End result: whenever a new WhatsApp message is sent ( or received) the flow will search for a contact at HubSpot CRM by phone number > if contact exists get the contact owner ID > transform the ID into a user friendly text > add text as a label to the chat in TimelinesAI.
Zap overview:
This workflow labels chats in TimelinesAI depending on who is the owner of the contact at HubSpot when new WhatsApp message is sent or received.
Create a new Zap at Zapier.com
Trigger :
app: search for and select TimelineAI
event: select New Sent Message or New Received Message depending on when you would like to start labeling chats at TimelinesAI. To track both events - create 2 separate zaps.
Account: choose your connection. If you don't have any connections, establish the connection with your TimelinesAI workspace by entering your token from https://app.timelines.ai/integrations/zapier/
Test the trigger. Depending on the event, wait for the new WA message to be received or send a new WA message yourself. Further steps require data from the trigger to be present. Make sure you've run this module and have data in the payload
Step #1: add a new step after the Trigger by clicking the + sign.
app: search for and select HubSpot
event: select Find Contact
account: choose your connection. If you don't have any connections, establish the connection by following on-screen instructions in Zapier.
First search property name: select Contact Information: Phone Number
First search property value: insert Recipient Phone Number from payload if you are triggering the flow by New Sent Message event. Insert Sender Phone if you are triggering the flow by New Received Message event.
Additional properties to retrieve : select Sales Properties: Contact Owner
Leave other fields as is and make sure to test the step and have output results in the payload.
Condition: add a new step after Find Contact module . Select "Filter" under the "Built-in" tools section
Only continue if…: select the ID from Find Contact module
Condition : select Exists
Path: add a new step after the filter: Select "Path" under the under the "Built-in" tools section
Path A- Path Rules:
Only continue if: select Sales Properties: Contact Owner
Condition: Text exactly matches
Value: enter the user ID of your team member at HubSpot. To find IDs of your team members at HubSpot follow steps from this HubSpot thread
Path A- step #1: add a new step after the path rule. Select "Format" under the "Built-in" tools section
Event: select Text
Transform: select Replace
Value: insert Sales Properties: Contact owner from the Fina Contact module
Find: type the user ID of your team member at HubSpot. To find IDs of your team members at HubSpot follow steps from this HubSpot thread
Replace : type the actual name of the team member associated with the ID. The name added at this step will be added as chat label at TimelinesAI
Leave other fields as is and make sure to test the step and have output results in the payload.
Path A- step#2: add a new step after the Format module. Search for and select "Webhooks by Zapier".
Event: select Custom Request
Method: select PUT
URL: add https://app.timelines.ai/integrations/api/chats/XXXX/labels . Where XXX is to be replaced by the chatID value from the payload ( passed by trigger)
Data Pass-Through?: select False
Data: add below, where XXXX is to be replaced by the output value for Format module
{
"labels": ["XXXX"]
}
Unflatten: select Yes
Headers: add 2 headers. Authorization Bearer XXX and Content-Type application/json . The XXX in Authorization header is to be replaced by your own token from https://app.timelines.ai/integrations/api/
Save your changes.
Under Path B, Path C repeat steps 8-11 to create separate labels associated with each team member at HubSpot.
End result: whenever a new WhatsApp message is sent ( or received) the flow will search for a contact at HubSpot CRM by phone number > if contact exists get the contact owner ID > transform the ID into a user friendly text > add text as a label to the chat in TimelinesAI.
Zap overview:
Updated on: 16/02/2024
Thank you!