ULTIMATE Braze Tutorial: How To Set Up Braze Webhooks To Make API Calls

I’ve set up hundreds of Braze Webhooks to work with tons of different Braze API endpoints, and I’ve decided to make a step-by-step tutorial on how to set up Braze Webhooks so you can also become a technical marketer and make these API calls!

The good news is that the setup process is quite consistent for many, many API endpoints, so this tutorial should cover a majority of your use cases.

I will be linking this video in all my future videos moving forward that requires any sort of webhook setup. My hope is that this video can be the ultimate tutorial video for any Braze webhook setup explanation, so that I don’t have to repeat the same instructions in my future videos.

And trust me, there will be plenty more tutorial videos with webhooks in the future, so please bookmark, favorite, like, and share this video!

🗣️ WATCH FULL YOUTUBE VIDEO HERE 🗣

https://youtu.be/lxvUGGhpRwk

What’s up everyone, my name is Allan, Founder and Consultant at For Now Marketing, and welcome back to our channel!

Before we get started, if you have any questions, whether you are currently using Braze or considering using Braze, please feel free to reach out! You can find these addresses and more in the Youtube description below.

Today, we are going to talk through How To Set Up Braze Webhooks To Make API Calls.

Let’s get started!

Why API?

Before we get our hands dirty with building Braze Webhooks, let’s spend some time talking about APIs in general, starting with the question: Why API?

There is a ton of different Braze API endpoints that all offer a different capability. I like to think of API endpoints as Customer Support Phone Extensions: dial 1 for billing, dial 2 for orders, etc.

Just like these Customer Support Extensions, Braze has different API endpoints that each offer a different capability; except Braze has about a 100 different API endpoints.

Many of these API endpoints offer capabilities that are not available on the dashboard UI. To build a dashboard UI, the Braze team has to spend their product, design, and engineering resources to determine how to make certain features available in the dashboard.

And not all features are absolutely necessary to be built in the dashboard. Instead, those features are available via the API.

Sometimes, Marketers can feel a little bit “stuck” when working with Braze, because there are many features that are only available via the API, like deleting users, scheduling campaigns, and more.

However, watch until the end of this video, and you’ll be one step closer to becoming a Technical Marketer who is confident with using Braze Webhooks to make API calls in Braze!

Braze API Endpoint Categories

Let’s briefly explore the different categories of API endpoints that Braze offers.

We have Campaigns and Canvas which allows us to retrieve some information about each of our campaigns and Canvases.

There’s a bunch of Catalogs, adding, editing, and deleting items in your Catalog programmatically.

Same thing with Content Blocks, we can list our existing ones, get some information, create, and update.

Braze recently launched some additional features with the Preference Center, and for every new feature launch, keep an eye out for additional API endpoints launches to supplement these new features.

Subscription Groups have a few endpoints.

And lastly, the category I use the most frequently, the User Data endpoints.

Among these, I personally use /users/export/ids very frequently because this endpoint is very helpful for grabbing data from each user, and it’s nice because we can query by email addresses.

I also started using /users/merge, and this is an awesome endpoint that was recently launched to help many Braze teams resolve duplicate profiles, because let’s be real, we’ve all been through or are going through the duplicate profile issue.

And /users/track, the most frequently used Braze endpoint, to log profile attributes, custom attributes, custom events, and more.

I would strongly recommend that you take some time to go through each of these categories and become familiar with what API capabilities exist in Braze. I’m sure you’ll find many features that you didn’t even know were possible with Braze!

Okay, it’s finally time to start building our Braze Webhooks!

Braze Webhook Template Setup

For our tutorial today, we’ll build a webhook template, so that for all future uses of the Braze Webhook, we can get started much more quickly.

Navigate to Templates → Webhook Templates → Blank Template, and we’ll call this template “Braze Webhook Main Template”.

Webhook URL

The first field to address is the Webhook URL. I want you to pause this video, and take a look at your Braze Dashboard’s URL. That’s where you can find which server you’re in.

For example, I am in the 02 EU server. Depending on where you are in the world and when you purchased Braze, you will have a different server.

Once you’ve located your server, come to the API Overview page, which I’ll link in the description below, and find your REST ENDPOINT.

The URL is simply your dashboard URL, the SDK endpoint is for the Engineers to work with when they’re integrating Braze, and the Rest Endpoint is what we’ll need for our API calls.

So I will copy the EU-02 rest endpoint, and paste it into my Webhook URL, back in my Braze webhook template.

Now, I want to clarify that when you’re actually building a webhook, you’re going to have to add more to this webhook URL. What we’ve grabbed so far is simply the root of our API endpoint.

However, if you visit any API documentation page, right here at the very top, you’ll find the specific API endpoint that you’ll need to add to the end of your Webhook URL. So for example, if I want to use the /users/track API, then I will go to the API documentation page, copy the endpoint, and paste it at the end of my webhook URL. And now, that Webhook URL is complete and ready to be used.

Settings

Next, let’s navigate to the Settings page, and this is where we add Request Headers. I think of these as some behind-the-scenes data required for the API call to work successfully. The good news is that the Request Headers are consistent for a large majority of the API endpoints, so you most likely won’t have to change these much.

Once again, on every API documentation page, you’ll see these Request Headers at the top of the Request body section, and they’re very often consistent: we have content-type set to application/json, and authorization set to Bearer YOUR_API_KEY.

So back on the Webhook Template, I’ll go ahead and add both of these. And over the years, I’ve experimented multiple times, and although I strongly, strongly encourage that you copy and paste these values directly from the documentation, I’ve also learned that I can lower case all of these, and the API call will still work successfully, although I would just follow the documentation strictly.

Okay, we are almost there with our Settings tab, except the API key. Let’s go over that process next.

Creating An API Key

Each API endpoint needs to be provided with an API key that is enabled for that specific endpoint. To create an API key, let’s navigate, in a new tab, to Settings → APIs and Identifiers → Create New API Key. And here, you’ll see a list of checkboxes that mirror every single API endpoint that you see on the Braze documentation.

Find the API endpoint that you want, check the checkbox, and scroll down to the bottom to click “Save API Key”.

And this API key is what we’ll need back in our Settings page. So I will copy the API key and replace the YOUR_API_KEY placeholder.

And because I’ve just exposed this API Key, I will now delete this API key.

Now you might be thinking: well can I just create an API key that has every single checkboxes enabled?

Yeah, you can, and in fact, many teams have an “all access” API key. However, there are 2 concerns with this approach:

1. It’s just riskier. In case your API key ever gets exposed, the entry way to every single API capability in your Braze dashboard is now compromised. The evil villain can now use up all your data points, send thousands of emails, and delete all your users. For security purposes, I recommend only enabling the endpoints that are absolutely necessary for that use case.

2. Braze is adding new API endpoints all the time, so when there are new API endpoints created, your “all access” key won’t actually be an “all access” key anymore.

Request Body

At this point, we are done with our Webhook Template! So let’s go ahead and hit “Save Template”, and this will be the Webhook Template that we can use for the majority of Braze Webhooks moving forward.

The last thing I’ll talk about briefly is the Request Body, and this won’t be part of our template setup, because the Request Body is actually different for every single endpoint, and probably the most difficult part of each webhook setup.

Going back to the API documentation page, every page will offer some sort of example request body that you can use as a starting point.

There’s the Request Body at the top which actually includes all the definitions and explanations which I wouldn’t use as my starter code.

But scroll down a little bit, and you’ll start to see Example Requests. Start from the left curly bracket to the right of this single quote next to data-raw, and grab every single line below until the end besides the last single quote.

This is usually my process when I set up new Braze Webhooks. I start with this starter code, and add or delete as needed.

It does take a little bit of reading, learning, research, and debugging for syntax errors when working with APIs, but I promise, the more you practice, the easier it gets.

The tutorial will end here now as this video was all about setting up a Braze Webhook. However, if there are any specific API endpoints that you’d like me to make a tutorial video for, please let me know in the comments, and I will try my best to surprise you with a quick delivery!

Thank You!

That’s it for today!

As always, if you have any questions, please share them in the comments. We’re happy to help! 🙏

If you learned something from this video, please subscribe for more awesome Braze videos in the future!

Thank you for watching, and see you next time!

allan@fornowmarketing.com

fornowmarketing.com

Previous
Previous

Braze Tutorial: How To Delete Users via API

Next
Next

Braze Tutorial: How To Send Emails With Attachments