if I correctly understood, you already provide to your users a chat application that they use
to talk with your chatbot.
What you want is a way to seamlessly handoff your conversation to humans, keeping your users
inside the same app, the same conversation.
I can suggest to you a common way that other Tiledesk customers use to achieve this task.
In summary: you should subscribe to Tiledesk webhooks (Webhooks - Tiledesk Docs) to get all Tiledesk messages and use the “send message” (see below) method to keep Tiledesk and your chat always synchronized.
You will have a mirror conversation on Tiledek, that your human agents will use to get messages from your own conversation. In the following steps is described how to keep both conversations synchronized, using Tiledesk subscriptions to get real time humans messages forwarding them to your chat in real time.
Reference tutorial: Sending and receiving messages with Tiledesk APIs - Tiledesk Docs
- Authenticate to Tiledesk. Authentication - Tiledesk Docs
We suggest to start with fixed user credentials - username/passwd - to start with a fast prototype: Authentication - Tiledesk Docs
- Once you authenticate to Tiledesk you should subscribe to the "message.create " event (see later) to get all messages notifications:
The subscription can start as soon as you create your conversation or later, after human handoff. For an integration prototype we suggest you to start subscription as soon as possible.
Subscribe to the “message.create” event to get all conversation messages.
- For every message sent in your human-chatbot conversation use the “send message” method to send this same message to the mirrored Tiledesk conversation (see the reference tutorial above). Use the “send message” (see later) method for each message sent in your conversation. It is important to keep Tiledesk synchronized with your conversation allowing your human agents, once the handoff completes, to see the history of the old messages exchanged with the chatbot.
Send message REST API:
As soon as you want to remove your chatbot and switch to human agents, (the easy way:) simply send a special message “\agent” from your chatbot to the end user (possibly hidden, if your chat allows hidden messages). Now a human will be assigned to the mirrored conversation on Tiledesk.
Finally, consider that you are already subscribed to the conversation. You will receive all Tiledesk messages through the webhook subscription, so you will receive all agents messages. You can now easily send all the agents messages to your chat using your own APIs.
I hope this helps.