While the Conversation.one platform provides you with full support to develop your business logic using Node.js/Javascript code, there are cases where you would want to develop it using some other coding language. To support that, Conversation.one offers an easy connection to your own backend server using JSON web APIs calls.

In this example, you’ll build a basic “what happened today” conversational application that will communicate with your backend server to provide responses to user’s requests. A conversational app is essentially the container or project and it contains intents, entities, and the responses you want to deliver to your user. Intents are the mechanisms that pick up what your user is requesting (using entities) and direct the app to respond accordingly.

Conversation.one is a build-once-deploy-anywhere platform, where your app can be deployed as an Alexa skill, Google Home action, Facebook Messenger bot, or a chatbot on your website

Create a Conversational App

If you don’t already have a Conversation.one account, sign up. If you have an account, log in.

Click on Create New App in the navigation. If it’s your first application, you will be redirected to the Create New App wizard automatically.

Select your industry and enter your company name. For the purpose of this tutorial, select “Other” for the industry, and enter “What Happened Today” as your company name. Uncheck “Add demo data” to start with an empty application. Click Next to continue.

Select the devices you want to support with your app. For this demo select Messenger, Amazon Alexa, Google Home, and Chatbot. Click Next to continue.

Create an Intent

An intent maps what a user says to what your app does. The intent we will create now will be invoked when the user asks for information on what happened today.

To create an intent:

Create a new intent named “whatHappenedToday”

In the User Says section, enter examples of what you might expect a user to ask for. The more examples you provide, the more ways a user can ask a question and the conversational app will understand. Enter these examples:

What happened today in history

What happened on this day in the past

What took place today

What occurred today

Click Save to apply your changes

Create Your Backend Code

For the purpose of this demo, we will explain here how to return a response from PHP backend code. However, you can use any language that you want to return a JSON response.

Add a Response

Try It Out

Now that your app can return real historical events to the user, try out what you have so far.

In the chat console on the right, type in a request. The request can be a little different than the examples you provided in the User Says section. This can be something like “what popped up today”. After you type the request, hit “Send”.

The chatbot will answer with some interesting event from the past. For example, “On this day, 1974 – The Rumble in the Jungle boxing match between Muhammad Ali and George Foreman takes place in Kinshasa, Zaire. Ali wins by KO in the eighth round, regaining the title of World Heavyweight Champion and causing Foreman´s first professional defeat.”