How to Use Webhooks — Thread the Needle with Braze

Webhooks are a crucial tool for marketers who use Braze due to their ability to connect different applications and platforms (or have them ‘communicate’ with each other). By enabling real-time data transmission, webhooks empower marketers to automate processes such as lead generation, customer engagement, and personalized messaging. This automation not only saves time but also ensures timely interactions with customers, leading to improved user experiences and higher conversion rates.

Webhooks facilitate seamless integration with various marketing tools, amplifying marketers’ capabilities to do everything from orchestrating campaigns more efficiently and deriving actionable insights from data analytics.

In this episode of Thread the Needle, Jesse Cohen, Solution Architect at Stitch, breaks down how to use webhooks, including:

  • What a webhook is
  • The difference between a standard API and a webhook
  • Common use cases for webhooks
  • Using action-based webhooks within Braze's Canvas

Transcript:


Hi, my name is Jesse Cohen, and I'm a solution architect here at Stitch. Today, I'm going to talk to you about Webhooks and Braze. This will include what a webhook is and some use cases to show how webhooks can be used in Braze. So let's begin. What is a webhook, also called an HTTP Push, API, or Web callback?

A webhook is a way for Braze to interact with other platforms using APIs, or even leverage the Braze API to pull data from within the Braze platform. While webhooks leverage APIs, they differ from the typical API because webhooks are action-based and event-driven, sending or receiving data when the action occurs, while APIs are typically request-driven or scheduled.

Webhooks are a great way to connect your different systems to Braze. External use cases include sending subscriber data to a data lake to update the subscriber's profile after an action is taken, interacting with other platforms to trigger social media messages in response to subscriber actions, and checking outside platforms for subscriber data not stored in Braze, similar to Connected Content. Webhooks can also be used to leverage Braze's own APIs for action on metadata within custom events and purchases. Some use cases in Braze include triggering a second canvas or sending users down a certain path in a canvas based on metadata and custom events.

I will now begin to demo a few of these use cases.

Here we have an action-based Canvas looking for users who perform a custom event, such as renting a movie. If the user rents a movie starring Denzel Washington, they should receive a Webhook that sends them down a second Canvas. If not, they should receive a generic email.

Let's see how this Canvas is built. The first step in this Canvas is a Webhook. This Webhook uses a placeholder URL and leverages Liquid to look at the Canvas entry properties to see if the first cast member listed is Denzel Washington. If the first cast member listed is Denzel, the Webhook will be sent to the user.

If not, the message will be aborted. The next step in the Canvas is a decision split. This decision split checks if a user received the Webhook created in the previous step less than one hour ago. If the user did not receive the Webhook less than one hour ago, they will receive the generic email.

If they did receive the Webhook one hour ago, they will go through a user update step to first update their user profile with the movie information and another Webhook to send them down a secondary Canvas. Let's take a look at the second Webhook. This Webhook uses the Canvas Trigger Send Braze API endpoint.

Additionally, it uses the Canvas ID and a bearer token to complete the Webhook body. To find the bearer token, you can navigate to Settings, APIs, Identifiers, and copy the API key from there. To find the Canvas ID, you can navigate to the secondary Canvas. This Canvas should be configured as an API-triggered schedule type.

With the API-triggered schedule type, you will be provided with a Canvas ID, which can be copied and used within the Webhook body. Now that the second Webhook is configured, let's see these canvases in action.

Here I have two API calls. The first is for a rented movie custom event for the 1989 movie "Glory" starring Matthew Broderick with supporting actor Denzel Washington. The other is also a rented movie custom event for the 2000 movie "Remember the Titans" starring Denzel Washington with supporting actor Will Patton.

I'll begin by sending this first API call for Glory.

We can confirm that Braze has received this API call by refreshing the Canvas and seeing the total entries increase from 43 to 44.

Additionally, I can confirm that I have received the email in my inbox.

Now let's try the second API call.I can confirm that this API call also successfully reached Braze by refreshing and seeing the total entries increase from 44 to 45. Additionally, I can check the second Canvas and look for the total entries to increase from 25 to 26.

I can also confirm in my inbox that I received the email specific to Denzel Washington.

This concludes our Webhook demonstration for today. Thank you for tuning in.

You might also like...