Tiledesk Docs
Search…
Quickstart
This Quick start guide will involve the following steps:
  1. 1.
    Create a new Tiledesk Project.
  2. 2.
    Create a new Tiledesk Chatbot and connect it to the Widget.
  3. 3.
    Connect the "start" intent to your service, replying with a dynamic answer.

Signup a user on Tiledesk

To use Tiledesk APIs or integrate your own chatbots is mandatory to signup a new user on Tiledesk. Then go to the console, available on the following link https://console.tiledesk.com/v2/dashboard
After signup please follow the proposed wizard to create your first Tiledesk project (for this tutorial you can jump the last step, relative to the widget installation).

Create a new Tiledesk project

To work with a chatbot you must have a Tiledesk project. Create a new one, name it "My chatbot":
image
Jump all the default options you find in the creation wizard clicking the Continue button.
There is no need to install the widget on your website, so you can jump the last "Install widget" step as well.
As soon as you create the project you will be redirected to the project home, the "dashboard".

Create a new Resolution bot

From the dashboard, open the Settings menu on the left and select the "Bots" option:
image
Press the "Add bot" button on the top, then choose the first option, "Resolution bot":
image
Choose a name for your bot (i.e. "Hellobot"), then "en" as the language, and press the CREATE BOT button.
image
When asked, reply "Activate bot" to this popup. This option will attach the chatbot to new conversations.
image
You have a new chatbot now, ready for coding.
You will see a couple of intents, the start and the defaultFallback intents.
image

Programming intents replies

This tutorial will show how to programmatically reply to intent with your own code, allowing you to reply to messages sent by end-users.
To programmatically customize intent replies, we'll need a web endpoint where all the chatbot's requests will be forwarded to be fulfilled with you dynamic messages. We'll use the great Repl.it service to fast create our own http REST endpoints.

Create and configure the chatbot endpoint

Go on Repl.it and press "+ new repl" button. Then select Node.js as the programming environment and choose a unique name for you repl project. We used mybot.
Hint We'll use Node.js for this example, due to his simplicity, low cost hosting and low learning curve. But keep in mind that the concepts in this tutorial can be easily applied to every web framework of your choice.
image
Press "+ Create Repl". Your initial source code will be generated and an empty index.js file is created, as the following:
image
Now choose the "examples" link inside the source code, and select the "Server (Express)" option:
image
The index.js file is updated with the following source:
image
Now we can add a new HTTP method POST to our web application, lets call this /bot. The new source will look like this:
1
const express = require('express');
2
const app = express();
3
const bodyParser = require('body-parser');
4
app.use(bodyParser.json());
5
6
app.get('/', (req, res) => {
7
res.send('Hello Bot app!')
8
});
9
10
/** Hello world **/
11
app.post('/bot', (req, res) => {
12
const intent = req.body.payload.intent.intent_display_name;
13
if (intent === 'start') {
14
res.json(
15
{
16
text:"Hello coding!"
17
}
18
);
19
}
20
});
21
22
app.listen(3000, () => {
23
console.log('server started');
24
});
Copied!
Source code: this complete example is available in our repl.it repo here
Press "Run" on top to start the application. Take a note of this api endpoint, in our case it is the following:
This url is our fulfillment endpoint. Now it's time to connect this endpoint to our previously created chatbot in the quickstart tutorial.

Connect intents to your apis

Now you can move back to the Tiledesk project console of your chabot and open the Settings menù on the left panel of the Tiledesk project, select the Bots option, then choose your previously created bot from the list:
Select the fulfillment section and activate the webhook endpoint. In the URL field set the repl.it endpoint:
image
Now press "UPDATE BOT".
The url is general for all the chatbot intents, but you have to activate the endpoint for each specific intents you want to be dinamically served with remote fulfillment.
In this example we choose the "start" intent to be fulfilled by coding. The "start" intent is special because it is the first intent called by Tiledesk when a conversation starts with a chatbot involved.
Let's choose the start intent from the intents list, then, from the intent view, activate the bottom switch "Enable webhook call for this intent", as in the following picture:
image
Now press the "UPDATE ANSWER" button. The intent is finally connected to our endpoint. It will reply to the end-user every time a conversation starts. Let's see this in action.

Test your chatbot

To test our bot press the "Simulate visitor" button from the console header.
image
This will open a new page, where you can see the widget in action just like it was installed on your website. Open the widget and press the "Start new conversation" button. The "start" message is secretly 🤫 sent to the chatbot, the start intent is suddenly triggered and the endpoint will reply with your programmatic message!
image
Well done! This was just the initial example. In the next tutorial we'll discover how to selectively execute programmatic logic based in specific intents.
You can find the full code of this tutorial on the repl linked here:
All the tutorial's source code is available on Github here
Do you have feedback on this article? Please send us your feedback writing an email to [email protected]