Things to do beforehand:
- Have your Calendly integration set up beforehand
- A campaign you will use should be created, most customers simply name the campaign they'll use "Scheduled Calendly Call"
- Let your CSM or Implementation manager know you are setting this up, since the webhooks required hit the Regal end point and will require your account's API key which is hidden on our backend
- Will also require a Calendly token
- This journey will help you differentiate between different kinds of Calendly scheduled calls, if you have several kinds
- The use of "welcome call" and "intro call" are just examples
Setting up the journey:
- Set up the trigger
- 'Condition Type': Custom Event
- 'Event Name': Calendly Call Scheduled
- Connect the trigger to a webhook
- Name the webhook "Get Event Attributes"
- 'Endpoint URL':
- https://api.calendly.com/scheduled_events/
- 'Method': GET
- 'Custom Headers'
- 'Authorization' : [INSERT KEY - Calendly token]
- 'Custom Headers'
- Connect the webhook node to a delay node
- 'Delay type': Standard
- 10 seconds
- Connect the delay node to a webhook
- Name the webhook "Set Event Name as Contact Attribute"
- 'Endpoint URL': https://events.regalvoice.com/events
- 'Method': POST
- 'Custom Headers'
- 'Authorization' : [INSERT KEY - Regal token]
- JSON Payload:
-
{
"traits": {"phone": "","calendlyEventName": ""}
} - Important to note that the number here
- 'Custom Headers'
- Connect the webhook node to a delay node
- 'Delay type': Standard
- 10 seconds
- Connect the delay node to a conditional node where we'll check for the Calendly event name
- Name the node "Welcome Call?"
- 'Condition Type': Contact Attribute
- 'Contact Attribute': customProperties.calendlyEventName
- 'Operator': Equals
- 'Attribute Value': Welcome Call
- There will be a YES path and a NO path from this conditional
- YES PATH - Connect the conditional node to a webhook
- Name the webhook "Set Calendly Agent As Contact Attribute"
- 'Endpoint URL': https://events.regalvoice.com/events
- 'Method': POST
- 'Custom Headers'
- 'Authorization' : [INSERT KEY - Regal token]
- JSON Payload:
-
{
"traits": {
"phone": "{{contact.contactPhone}}",
"calendlyAgentEmail": "{{event.properties.calendlyAgentEmail}}"
}
}
- 'Custom Headers'
- Connect the webhook node to a delay node
- 'Delay type': Delay Using Time from Property
- 'Delay Until': Triggering Event
- 'Select property name': properties.scheduledTime
- Select 'Minus' rather than 'Plus' and then set 5 minutes
- Connect the delay node to a conditional node where we'll check that the Calendly call hasn't been canceled since scheduling it
- Name the node "Call Canceled?"
- 'Condition Type': Custom Event
- 'Event Name': Calendly Call Canceled
- Click the plus sign 'Add Property Condition'
- 'Select property name': properties.calendlyEventId;
- 'Operator': Equals
- 'Property Value':
-
{{event.properties.calendlyEventId}}
- This checks whether the Canceled event ID matches the original ID scheduled, if they match then the call was canceled
- 'Operator': Equals
- Connect from the "No" on the Conditional Node to an Action node "Create Call Task"
- Select the campaign that you created, most likely "Scheduled Calendly Call"
- Connect the webhook node to a delay node
- 'Delay type': Standard
- 30 seconds
- Connect the delay node to a webhook
- Name the webhook "Update Calendly Agent"
- 'Endpoint URL': https://api.rv-apps.io/tasks/update
- 'Method': POST
- 'Custom Headers'
- 'X-Brand' : [brand slug, check with Regal]
- 'Content-Type' : 'application/json'
- 'X-Api-Key' : [INSERT KEY - Regal token]
- JSON Payload:
-
{"contactPhone": "{{contact.contactPhone}}",
"campaignId": 65,
"update":{
"attributes":{
"calendlyAgentEmail":"{{event.properties.calendlyAgentEmail}}"
}
}
}
- 'Custom Headers'
- NO PATH - Connect the conditional node to another conditional node where we'll check for the Calendly event name
- Name the node "Welcome Call?"
- 'Condition Type': Contact Attribute
- 'Contact Attribute': customProperties.calendlyEventName
- 'Operator': Equals
- 'Attribute Value': Intro Call
- Connect the webhook node to a delay node
- 'Delay type': Delay Using Time from Property
- 'Delay Until': Triggering Event
- 'Select property name': properties.scheduledTime
- Select 'Minus' rather than 'Plus' and then set 5 minutes
- Connect the delay node to a conditional node where we'll check that the Calendly call hasn't been canceled since scheduling it
- Name the node "Call Canceled?"
- 'Condition Type': Custom Event
- 'Event Name': Calendly Call Canceled
- Click the plus sign 'Add Property Condition'
- 'Select property name': properties.calendlyEventId;
- 'Operator': Equals
- 'Property Value':
-
{{event.properties.calendlyEventId}}
- This checks whether the Canceled event ID matches the original ID scheduled, if they match then the call was canceled
- 'Operator': Equals
- Connect from the "No" on the Conditional Node to an Action node "Create Call Task"
- Select the campaign that you created, most likely "Scheduled Calendly Call"
- Connect the webhook node to a delay node
- 'Delay type': Standard
- 30 seconds
- Connect the delay node to a webhook
- Name the webhook "Update Calendly Agent"
- 'Endpoint URL': https://api.rv-apps.io/tasks/update
- 'Method': POST
- 'Custom Headers'
- 'X-Brand' : [brand slug, check with Regal]
- 'Content-Type' : 'application/json'
- 'X-Api-Key' : [INSERT KEY - Regal token]
- JSON Payload:
-
{"contactPhone": "{{contact.contactPhone}}",
"campaignId": 65,
"update":{
"attributes":{
"calendlyAgentEmail":"{{event.properties.calendlyAgentEmail}}"
}
}
}
- 'Custom Headers'
What your journey should look like: