Custom Request assignment
Assign request to a custom agent
Sometimes you don't want to rely on Tiledesk native assignment logic, that is a round-robin algorithm through the available agents in a specified department.
Suppose that you want to assign a request (and the corresponding conversation) to a specific agent. You can implement your own logic using webhooks.
Create your webhook project
Configure webhooks for the project
Go to Settings > Project Settings > Developer and click on "MANAGE WEBHOOK".
Add a new webhook whose endpoint matches your forked Replit application's endpoint followed by /webhooks.
Make sure to use your application endpoint so you can modify the code as needed.
Create the subscription.
Create and attach a bot
Go 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 and make the bot immediately available to end users.
Leave all settings on default.
Test the behavior
When a request is updated, your web application will receive a "request.update" event. The example code checks if no participants are present in the conversation. If participantsAgents[] is empty, the request is in the Unassigned queue (the "pool"). The code then queries teammates and selects the first one to assign the request. You can replace this logic with your own assignment algorithm.
Self hosted installation
The API_ENDPOINT variable in the source code points to the Tiledesk cloud by default.
If you installed Tiledesk using the Docker compose distribution, use one of these values for your API_ENDPOINT var:
On localhost:
API_ENDPOINT = localhost/api/On your own server:
API_ENDPOINT = ${YOUR_SERVER_HOST}/api/You can find more on the Docker installation endpoints here: https://github.com/Tiledesk/tiledesk-deployment/blob/master/docker-compose/README.md#service-endpoints
Last updated 2 years ago
For reference: agent-handoff example on Replit — https://replit.com/@tiledesk/agent-handoff#index.js
Create your project, webhook, bot and change the routing to pooled to enable custom assignment via your webhook.