skip to Main Content

How To Use External Requests In ManyChat

Max van Collenburg By Max van Collenburg

In this guide, you’ll learn how you can use ManyChat their External Request tool to make your bot smarter & integrate with other tools.

Most people are a bit overwhelmed with this because it looks a bit complicated. But it’s actually really easy (and freakin’ handy) when you get the hang of it.

Let’s dive in! 🙌

What is an External Request?

The External Request is an action inside ManyChat that allows you to send all kinds of data to other places on the internet.

You can for example trigger Make webhooks, send stuff to your server, or use special scripts to get certain info (like the current day & time).

It allows you to do really cool things and make your bot smarter, but it’s a bit technical.

But luckily I’m also not a programmer, so here is my full guide for non-techy people like you and me.

1. Request Type

You can choose between a GET or POST request.

ManyChat External Request: request type

They’re both pretty similar.

The main difference is that with a GET request you have to place the values inside the Request URL, while with the POST you have to place the values inside the body (which is more secure).

You will probably most often you’ll need POST.

I only use GET when the API of the tool I’m trying to connect with doesn’t accept POST.

2. Request URL

This one’s easy.

Simply insert the URL or webhook here.

ManyChat External Request: request URL

But you’ve to make sure it’s an https URL, which means it’s secure.

3. Headers

This is often used for authentication or to tell the receiving end what kind of content it is.

Here’s an example:

ManyChat External Request: headers

See how we used it for authorization & to tell what kind of content it is?

You have the ‘key’ on the left and then the value next to it.

Most often the tool you’re trying to integrate will tell you how to set this.

4. Body

The body contains what you want to send over.

Later in this guide, I’ll show you how you can write a simple JSON code to send anything you want.

Note that you can also insert variables or all the subscriber’s data at once.

ManyChat External Request: body example

5. Response

You’ll always get some kind of response back.

This can be an error, a success message or a custom response.

Below is an example.

There is nothing you can do here.

It’s just to check if it’s working properly.

6. Response mapping

It’s possible to save parts of the response into User Fields.

You tell ManyChat what you want, and where you want to store it in.

Here’s a quick example of how we store the value of $.current_day into a user field.

ManyChat External Request: Response Mapping

But we’ll dive deeper into this later.

How do you write simple JSON?

It’s easy! Really!

I know you’re not a programmer (like me).

It’s just a list of values in a certain format.

Let’s take a look at this example;

{
"fruit":"banana",
"amount":"3"
}

This will send two values;

  • fruit = banana
  • amount = 3

We have the name of the value, then the value itself.

The JSON works like this;

We use a { to open the JSON, and a } to close the JSON.

{
}

In-between that we have the values.

You always start with the name of the value surrounded by brackets

{
"fruit"
}

Then we want to add the value of fruit.

To do that we put a : behind the “fruit”, so it will be “fruit”:

{
"fruit"
}

Then we add the value, surrounded by brackets again, so it will be “fruit”:”banana”

{
"fruit":"banana"
}

And now we want to add a second value.

To do that we have a place a comma behind the last value and start a new row.

{
"fruit":"banana",

}

And on the new row we insert the name of the second thing we want to pass on & it’s value.

{
"fruit":"banana",
"amount":"3"
}

Please notice that we do not add a comma on the second row.

This is something I see people do wrong over and over again 😛

But this is basically all you need for creating the body of your External Request in ManyChat.

You can make it more complex with arrays, but you’ll probably never use that.

Use External Request to trigger Make webhook

Make calls themselves the glue of the internet.

It allows you to do all kinds of fun stuff to make your bot smarter & to integrate ManyChat with other tools.

But how do you trigger an Make webhook so you can start a scenario?

I’ll show you how.

But let’s tackle something first.

You cán trigger a webhook using the standard Trigger Make action.

But this doesn’t allow you to customize anything.

It’s sending all the subscriber’s data over to Make, without giving you the possibility to change what you want to send and you can’t store the response you get back from Make in a Custom Field.

(more on response mapping later)

That’s why I don’t recommend using this, always use the External Request and not the Trigger Make action.

Response mapping

Ok, so when you’re creating an External Request you’ve probably noticed the “Response mapping” tab.

This is where you can find response mapping in the External Request

This thing is extremely cool.

But I’ve to admit, it’s a bit hard to get.

Let me give you an example with Make.

When you trigger an Make webhook with your External Request, you always get a response back from Make.

Standard is this “Accepted”.

Nothing special, right?

But did you know that you can customize this response?

And that you can save that response into a custom field?

Isn’t that freakin’ cool? 😄

Let me give you an example.

In conversations, I really like to use the current day of the week.

So you can say stuff like “Have a great Monday!”

To achieve this, we have a trigger a webhook and store the response (which is the current day of the week) into a User Field.

Inside the flow, we trigger the webhook.

Trigger the webhook with an external request

Then, in Make, we create a webhook response.

Create the webhook response in Make

In this response, we send the current day of the week back to ManyChat.

Here’s the screenshot of the JSON we sent back, in case the example above went too quick.

Request example: Current day json

So let’s quickly test if it worked.

Test the external request

Yep! You see that the response is Tuesday (the day I wrote this article).

And with Response Mapping, we map this value into a user field.

To do that, we use $.current_day and select the Current Day user field.

Response mapping filled

The $ is like the main thing, then you have the amount of dots for how deep the value is and then you have the name of the value.

And then, when you add the User Field as a variable into your conversation it will show the current day 🙃

use current day variable in flow

In Messenger this will look like this:

Messenger preview of current day

Cool hu?