A quick start tutorial for setting up an AI chatbot using

In this tutorial, we will learn how to set up a conversational AI Chatbot using and

Web Demo


  • Golang — Basic
  • Ngrok (local tunnel to your laptop for development purposes)
  • MessengerX Wit template
  • Platform API Token / Key
  • GNU Screen / Terminal
  • Javascript Enabled Browser (Google Chrome)

Today, we will learn how to set up a conversational AI Chatbot using and Machaao Chatbot Template on platform.

So, assuming we have all the above covered — Let’s get started!

Step 1: Register and Get your FREE API Key

Visit then login or signup on the platform. Login

Fill out the form shown below and create a new chat bot, place None in webhook URL and image URL and then press create.

MessengerX Create App

Click on Settings and copy the API Key, you will need it later.

Now, we need API Token from So, sign up on Create App

Image Source

Click on Create > Your App > Settings then copy the server access token, that is your Wit API Token.

Trending Bot Articles:

1. Conversational AI: Code/No Code

2. Chatbots 2.0: Simplifying Customer Service with RPA and AI

3. Question Answering on Medical conversation

4. Automating WhatsApp with NLP: Complete guide

Step 2: We will use the MessengerX Wit github template

git clone
cd messenger-wit-go

Step 3: Installing the basic requirements

You can download ngrok from ngrok — download

Download & Install the Go-Lang stable version from here:

go get
go get

ngrok allows you to expose a web server running on your local machine to the internet.

Step 4: Setup the Sample Chatbot Project & Update the API Key / Token

We will be setting & API token as environment variable.

# For Linux and Mac OS
export MachaaoApiToken=<YOUR-MESSENGERX-API-TOKEN>
export WitApiToken=<YOUR-WIT-API-TOKEN>
# For Windows (PowerShell)
$env:MachaaoApiToken = '<YOUR-MESSENGERX-API-TOKEN>'
$env:WitApiToken = '<YOUR-WIT-API-TOKEN>'


You can even directly set the respective API Token in the main.go file.

Step 5: Starting GoLang Chatbot Server Locally

Now, navigate to the working directory messenger-wit-go

Open bot.js in an editor and at line 17 place your API-KEY, copied from portal.

go run main.go

Press ‘Ctrl+a’ then ‘d’ to detach from the screen.

Step 6: Start NGROK server

Note: If you are using VPS then just add PORT 3000 to inbound rules and skip the below step.

ngrok http 4747

Note: Copy the forwarding url. You will need this.

Press ‘Ctrl+a’ then ‘d’ to detach from the screen.

Step 7: Updating the webhook on Dev Portal

Log on to and click on settings to update the chatbot webhook URL.

Paste <FORWARDING-URL>/machaao_hook or paste the VPS domain:4747 and save it.

That’s it.

The Chatbot will also be available on the web.

If everything went well you can see your chatbot at<chatbot_name> OR<chatbot_name>

To integrate the chatbot into your website use iframe.

<iframe src=”<chatbot_name>”width=”400" height=”600"></iframe>

Step 8: Training the Chatbot on

We will now use to train our chatbot to understand the input and extract useful information from the user input message. We have to input sample input text and define what type of data we want.

Type the sample text, highlight the sample data you want to capture then select from the entity or create one, then click on Train and Validate.

Entity detects the similar data and captures it.

After training few data headover to settings to test the AI, if it is getting desired value or not.

In the HTTP API section enter your query then send a GET request to the API.

You would get result similar to this.

Curl output

After getting desired entity value, you are good to go.


With and, you can create and deploy your scalable ChatBot in no time, as we already know the scalability and performance of GoLang.

Github Repo: MessengerX-Wit-Go


Checkout my other tutorials too

Happy Coding 🙂

Abhishek Raj | Connecting Bot Developers to App Publishers

Don’t forget to give us your 👏 !

A quick start tutorial for setting up an AI chatbot using was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

Source link

Related posts

Heart rate variability based machine learning models for risk prediction of suspected sepsis patients in the emergency department.


An End-to-End Deep Learning Histochemical Scoring System for Breast Cancer TMA.


Smart Contract Co. OpenLaw Explores ‘Stablecoins’ With Dai


This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy


COVID-19 (Coronavirus) is a new illness that is having a major effect on all businesses globally LIVE COVID-19 STATISTICS FOR World