Skip to main content

Custom Webhook

Learn how to use the custom webhook action to gather or update external data at a certain point in a conversation

Bryce DeCora avatar
Written by Bryce DeCora
Updated yesterday

Overview

You may want to pull in external information at a certain point in a conversation or update external data. The custom webhook action allows you to do this if you are familiar with how API Requests work.

Options

When setting up a Custom Webhook action, there are a few settings you have access to. If you want to use the output from the custom webhook later on, make sure you input test data and then click Test Webhook. Once you verify you receive the response you desire, click save. This step must be done if you want to use the output variables in later nodes as variables.

URL

The URL is the endpoint where you want to connect and send and/or receive information. This can be obtained from that software's API Documentation. Like with other nodes, you can click on the "+" to use variables within the URL.

Method

This method is specified by the software's API Documentation as well. Learn more about these options like GET and POST with this resource here.

Query

If there are query parameters you would like to be utilized within the URL, you can include those here. Learn what a query parameter is here.

Body Data

There may be endpoints that require you to send them JSON or Form Data. Either of those are options and you can include the data in the field below. This sends to the endpoint to be used based on their API Documentation.

Headers

Sometimes you'll be required to send a header with your request. Typically things like authentication tokens are sent within the header. CloseBot gives you the ability to send headers with the custom webhook from within the Advanced Settings.

Wait for Response Before Continuing

CloseBot can still respond to messages while waiting for a response from the Webhook. However, by default it will stay on this Custom Webhook action (not contuing onto the next node) until it has received a response. If you would like the agent to move onto the next node immediately, you can deselect this option. This is common to use in scenarios where you don't care what the response is. For example, if you're sending an event for Google Analytics at a certain phase in the conversation, you don't care what the response is and may want to continue to the next action.

Example Usage

Let's imagine we want to get a website visitor's name and then use a free endpoint to determine their most likely age based on their first and last name. Finally, we will ask them to follow us on Facebook if they are likely under the age of 40.

Let's start with an objective to get the contact's first and last name.

Next, let's execute a Webhook to this free endpoint that takes in a name and gives a likely age. This step shows us setting up a test that we can run using Test Webhook with a test name. We have to run this initial test with fake values first (Bryce DeCora in this case) so we can get a sample response back. As seen in the short video below.

METHOD β†’ GET

QUERY (name) β†’ Contact Name

Once this test is run, you can change fake values to variables and then click SAVE.

Note: The Test Result from your test run must be visible in the Response box when you click save. You cannot come back and modify the webhook later without again running a Test Result once again, otherwise you will not have access to those variables later.

After you've done this, you'll notice you can reference the variables in later nodes (count, age, name in this example).

Now let's use a branch action to route depending on the likely age of the contact.

Finally, let's use the statement node to make the Agent recommend our Facebook Group if the contact is likely under 40 years old. Either way, let's end this with a conversation action for continued Q&A.

Let's see how a test of this conversation goes... it looks like my name sounds like a name of someone under 40 πŸ₯³

Summary

CloseBot allows you to have extreme control over your lead qualification flows, including calling in external resources or updating them on the fly! Have creative use cases for the custom webhook action? Let us know in our Facebook Community!

Did this answer your question?