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
  • Assign request to a custom agent
  • Create your webhook project
  • Self hosted installation

Was this helpful?

  1. APIs
  2. Tutorials
  3. Webhooks

Custom Request assignment

PreviousWebhooksNextRequest transcript on close

Last updated 1 year ago

Was this helpful?

Assign request to a custom agent

Sometimes you don't want to rely on Tiledesk native assignment logic, that is a round robin alghoritm through the available agents into a specied department.

Suppose that we want to assign a request (and the corrispondenr conversation) to a specific agent. You can implmemente your own logic using webhooks.

Create your webhook project

Go on replit and fork the following app:

Then go on Tiledesk and create a new project. You can call it "Custom routing".

image

Now move in the Settings > Project Settings > Developer section and click on "MANAGE WEBHOOK"

Add this new webhook, taking care that the endpoint corresponds to the endpoint of your forked replit application followed by /webhooks:

Please use your application endpoint so you can modify the code as needed.

Create the subscription.

Now move to the Bots section and create a new bot. Choose "Resolution" as the bot type.

Name it as you prefer, create it and press "Activate" when asked. This will "attach" the new chatbot to the Default Department making the bot immediatly available to end users.

Leave all settings on the default.

Now move to "Routing & Departments" section.

Select the "Default department" and change the Routing rules from the (default) "Assigned" to the "Pooled" mode.

Well, it's done. Now let's test.

As soon as a new request is updated the code on your web application will receive an event "request.update".

The code will check if no participiants are present in the conversation. If participantsAgents[] is empty this means that the request is in the Unassigned queue (aka in the "pool"). The code then simply queries all the teammates and select the first one, who the request will be assigned to. Feel free to choose your own logic to implement the assignment.

Self hosted installation

The API_ENDPOINT var in the source code points to the Tiledesk cloud.

On localhost:

API_ENDPOINT = localhost/api/

On your own server:

API_ENDPOINT = ${YOUR_SERVER_HOST}/api/

image

In our case this is the .

image
image
image
image
image

If you installed Tiledesk using the please use this value for your API_ENDPOINT var:

You can find more on the Docker installation endpoints .

endpoint
Docker compose distribution
here
agent-handoff
image