Open a web chat on the test copy
Opens Landbot's web chat on the bot's test copy, the one PUT /bots/{bot_id}/test deploys the
draft to, the way the builder's preview opens its own. Only a web bot (channel_family: landbot)
has a test copy you can talk to this way.
You talk to it as a test visitor of your own, one per member, which is not the one the builder's preview gives you. Each call starts that visitor's conversation over from the greeting, as the preview does, so keep one web chat open at a time: one opened before is the same conversation.
You get the configuration a page starts the web chat with, as it is, for example
new Landbot.Container({container: '#chat', ...config}) with the script at
https://cdn.landbot.io/landbot-3/landbot-3.0.0.js. It carries the visitor's credentials
(customerToken and landbotToken): they talk to the test copy as that visitor and do nothing
else, but they do not expire, so hand them only to the page that runs the chat.
It also carries the bot's Custom JS (foot) when the brand has the Custom Code add-on, and
the web chat runs it in the page that starts the chat, with everything that page can reach. Start
it in a page on an origin of its own that holds nothing else, such as a sandboxed iframe.
Takes no body, scope bots:write.
Path Parameters
- Type: stringFormat: uuidbot
_id required
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
curl https://api.landbot.io/v0-alpha/bots/123e4567-e89b-12d3-a456-426614174000/test/web_chats \
--request POST \
--header 'Authorization: Token YOUR_AGENT_TOKEN'
{
"data": {
"config": {
"additionalProperty": "anything"
}
}
}