Submit a ticket

Dev Tools: External Request

External request (PRO) allows you to send an HTTP request to your server with different types of data:

  • Contact status
  • First name
  • Last name
  • Name
  • Gender
  • Language
  • Timezone
  • Live-chat URL
  • Custom fields

External request function supports GET and POST HTTP methods. To create external request node you need to go to Actions -> External request.

Once you click on Add your request button it will open the configuration window. In configuration window you will be able to choose the request type (GET or POST):

After you have set up your request type, you will need to set proper request URL and fill in Headers and Body fields.
Here's the example of External Request body from https://api.manychat.com/swagger#/Sending/post_fb_sending_sendContent:

{
"subscriber_id": 0,
"data": {},
"message_tag": "ISSUE_RESOLUTION"
}

data's {} here filled with Response Format from here: https://manychat.github.io/dynamic_block_docs/.
More info about available headers could be found on the Internet. For example: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers 

When it is done you can test your request by going to Response tab and click on Test the request

If everything is done correctly you will get HTTP 200 Code like that:

Let’s create a default reply flow for Star Wars fans. There is a good free API test service called https://swapi.dev/. We want to show the film title and the opening crawls by answering any word to the bot. If the word is contained in the title, then we will show the title and the opening crawl.

Firstly, create two CUFs to save the title and the opening crawl. Then go to the Default reply section, create an Action block, and choose External Request.

We'll use an API search method https://swapi.co/api/films/?search=hope and send the last user input there. Next, we need to match JSON response parameters with our CUFs.

Here is our result in the Facebook Messenger.

Hopefully this helps!

PS: We also kindly recommend to read our DevTools Quick Test article to learn more on the subject.