Overview
The following article describes how to use Dock's Webhooks within a HubSpot workflow.
Example use cases:
Completing Dock Task -> Updating Field in HubSpot
Viewing Dock Workspace -> Sending Email from HubSpot
Getting Started
For the purposes of this article, we'll walk through the example of completing a Dock task to updating a field in HubSpot.
Initial Set Up in Dock
Step 1: In Dock, set up an API Key
Go to settings, and make sure you have an API key set up:
You won't actually use this API key, but it enables an important setting on our side that you'll use later.
Step 2: In Dock, create your Webhook event
Go to settings and click Webhooks.
Click "Create Webhook" and give it a name. You'll then be brought to the Webhook setup page:
Step 3: Click "Create Subscription" and select subscription type
When you're done, keep this tab open. You'll come back to this screen.
Creating the Workflow in HubSpot
Step 1: In a new tab, go to your HubSpot Workflows and create a new workflow.
Start your workflow from any object (company, deal, or contact are the most common for this use case).
Step 2: Select the trigger to "When a webhook is received"(under Advanced options).
Step 3: On the next screen, click Add webhook event and give your event a name.
We recommend you match this event name with the event name in Dock.
Step 4: Copy the Webhook URL from Hubspot
Adding the test URL to Dock
Step 1: In your Dock Webhooks setting, hover over the Subscription and click Details.
This will open up the Detail Settings sidebar:
Step 2: Scroll to the bottom and then paste the Test URL from HubSpot.
You'll need to delete the "https://" from the URL.
Step 3: Once the URL is added, click Test.
This will send data back to HubSpot.
Make sure HubSpot received the test event
In HubSpot, the screen should look like this if it's a successful event:
Add Hubspot URL to Target URL in Dock
After the test is successful, go back to Dock and add that same Webhook URL into the Target URL and click Save.
Set up mapping in HubSpot
HubSpot will automatically pull in a whole bunch of data related to the Webhook payload. We find it's easier to just delete all of these events and start from scratch. Click the Trash icon next to each data to remove.
When you're done, you'll see the option to add events from scratch.
For any event, you'll need to include the HubSpotAccountID so HubSpot knows where to send this data. This data type is "number":
To send the Task data to HubSpot, you'll need to select the "templatePlanTaskID" as pictured above. The data type for this ID should be "Text".
We also are going to include the email address of the person who is completing the task.
Match Enrollment Property
Use the CompanyID as the unique identifier to match the properties:
When you're done, click Next and everything should be all setup.
Add the webhook event to the trigger.
Click on the webhook name to add it to the trigger:
Then click "edit criteria" to setup the trigger's filters:
Set up the trigger for a specific task
For this particular use case, we'll show you how to set up the trigger based on a specific Dock Task ID. This will tell HubSpot to only take an action when a specific task in Dock is completed.
a. On the HubSpot side of things, you'll select "Dock Task ID" as your criteria. But then you'll need to find the specific ID for the task:
b. Go back to Dock and find the Dock template where the task lives.
c. From within the template, navigate to the task and click the ellipsis (...)
d. Click "Copy ID"
e. Go back to HubSpot and paste this ID into the HubSpot workflow criteria
Now the Dock Webhook trigger is setup.
Anytime that task is completed in a corresponding workspace, it will send an event to HubSpot and trigger this workflow.
In this above example, any time that task is completed, we'll update the field "Assets Uploaded".
Testing the Webhook + Workflow Setup
We highly recommend that you test this set up using fake HubSpot Companies/Deals and Dock Workspaces. When testing, make sure that the Dock workspace is connected a Company/Deal record in HubSpot.
You can use the action logs to make sure the events are coming through properly.
Here's what it looks like when there's a successful trigger: