Tiledesk Developer Hub
WebsiteCommunityTutorialsGet started
  • Introduction
  • Community
  • Ask for Support
  • Public Roadmap and Changelog
  • Tutorials
  • Widget
    • Widget SDK
    • Javascript API: Methods
    • Javascript API: Attributes
    • Javascript API: Listeners/Events
    • Widget Authentication
    • Widget Angular integration
    • Widget React integration
    • Widget for Android with WebView
    • Widget for iOS with WKWebView
    • Widget for Flutter with WebView
    • Widget for React with WebView
    • Widget for Wix Website platform
    • Tutorials
      • Hide widget
      • Show/Hide widget programmatically
      • Force widget loading without user interaction
      • Mobile positioning
      • Custom size (width/height)
      • Installing widget on selected pages
    • Conversation Embedded Apps
      • Payment App Tutorial
      • Prechat form App Tutorial
    • Advanced
      • Preset the Widget on a specific Department
      • Authentication Flow
      • Widget protocol specs
      • Prechat Form JSON specs
      • Prevent multiple conversations
      • Old versions
        • Web SDK v4
  • External Chatbot
    • Introduction
    • Hello World tutorial
    • Chatbot to Human handoff
    • Send Text Buttons
    • Advanced Tutorials
      • Introduction
      • Tutorial 1 - Dialogflow as external chatbot
      • Tutorial 2 - Buttons and images
      • Tutorial 3 - Automatic human handoff with fallback intent
      • Tutorial 4 - Explicit Human handoff with user intent
      • Tutorial 5 - Gracefully handling operating hours during handoff
      • Generate Dialogflow Google Credentials file
    • Rasa tutorials
      • Rasa Tutorial 1 - Rasa as external chatbot
  • Resolution bot
    • Introduction
    • Quickstart
    • Webhook service
    • Rich messages
    • Tutorials
      • Chatbot chooser (multilanguage)
      • Department chooser
      • Order info (webhook)
  • APIs
    • REST APIs
      • Introduction
      • Authentication
      • Requests
      • Leads
      • Messages
      • Activities
      • Projects
      • Team
      • User
      • Analytics
      • Canned responses
      • Tags
      • Events
      • Jwt
      • Labels
      • Images
      • Files
      • Segments
      • Chatbots
      • Knowledge Bases
        • Knowledge Base
        • Contents
        • Question & Answer
      • Management Api
        • Departments
        • Groups
    • NodeJS SDK
    • Webhooks
      • Subscriptions
    • Conversation Messages APIs tips
    • Realtime API
    • JWT Authentication
      • JWT Custom authentication Tutorial
    • Tutorials
      • REST API
        • Sending and receiving messages with Tiledesk APIs
        • PHP Tiledesk REST API example
        • Import multiple messages into Tiledesk using REST APIs from third party app
      • Webhooks
        • Custom Request assignment
        • Request transcript on close
  • Apps
    • Build Custom App - Quick start
    • External Channels integration flow diagram
    • Telegram integration tutorial
  • Dashboard & AgentChat SDK
    • Dashboard SDK
    • Agent Chat SDK
  • Architecture
    • Architecture overview
    • Components list
    • Bot Design diagram
    • Multi Channel Message Flow
  • Installation
    • Installation
    • Running Tiledesk using Docker Compose
    • Running Tiledesk with Kubernetes using Helm
    • Choosing Hardware
  • Configuration
    • Chat21 channel configuration
    • Email parameters and templates configuration
    • Configure the logging system
Powered by GitBook
On this page
  • Signup a user on Tiledesk
  • Create a new Tiledesk project
  • Create a new Resolution bot
  • Programming intents replies
  • Create and configure the chatbot endpoint
  • Connect intents to your apis
  • Test your chatbot

Was this helpful?

  1. Resolution bot

Quickstart

PreviousIntroductionNextWebhook service

Last updated 1 year ago

Was this helpful?

This Quick start guide will involve the following steps:

  1. Create a new Tiledesk Project.

  2. Create a new Tiledesk Chatbot and connect it to the Widget.

  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 . Then go to the console, available on the following link

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:

Press the "Add bot" button on the top, then choose the first option, "Resolution bot":

Choose a name for your bot (i.e. "Hellobot"), then "en" as the language, and press the CREATE BOT button.

When asked, reply "Activate bot" to this popup. This option will attach the chatbot to new conversations.

You have a new chatbot now, ready for coding.

You will see a couple of intents, the start and the defaultFallback intents.

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.

Create and configure the chatbot endpoint

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.

Press "+ Create Repl". Your initial source code will be generated and an empty index.js file is created, as the following:

Now choose the "examples" link inside the source code, and select the "Server (Express)" option:

The index.js file is updated with the following source:

Now we can add a new HTTP method POST to our web application, lets call this /bot. The new source will look like this:

const express = require('express');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.json());

app.get('/', (req, res) => {
  res.send('Hello Bot app!')
});

/** Hello world **/
app.post('/bot', (req, res) => {
  const intent = req.body.payload.intent.intent_display_name;
  if (intent === 'start') {
    res.json(
      {
        text:"Hello coding!"
      }
    );
  }
});

app.listen(3000, () => {
  console.log('server started');
});

Press "Run" on top to start the application. Take a note of this api endpoint, in our case it is the following:

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:

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:

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.

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!

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:

Do you have feedback on this article? Please send us your feedback writing an email to info@tiledesk.com

image
image
image
image
image

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 service to fast create our own http REST endpoints.

Go on 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.

image
image
image
image

Source code: this complete example is available in our repl.it repo

This url is our fulfillment endpoint. Now it's time to connect this endpoint to our previously created chatbot in the .

image
image
image
image

All the tutorial's source code is available on Github

Repl.it
Repl.it
here
https://mybot.tiledesk.repl.co/bot
quickstart tutorial
https://replit.com/@tiledesk/mybot#index.js
here
Tiledesk
https://panel.tiledesk.com/v3/dashboard