Webhooks
Explore incoming and outgoing webhooks in the Ebbot Chat platform.
Incoming webhook
An incoming webhook lets you use the conversational AI and intent detection in a platform of your choice. You can start conversations and Ebbot will try to match the phrase with a scenario and respond with a proper answer.
Follow the instructions below to add an incoming webhook
Head to the webhook page in the integrations section in the left sided menu.
Click on add and then choose incoming as the type
Give the webhook a name
Click on save
Send a request
Once you have the webhook URL you only need to make a post request to that URL to start the conversation. You can run the conversation in sandbox mode which means that it will not be created in the conversations table. The bot will still respond as in a regular conversation.
On the first request that isn't in sandbox mode you will receive a chat id that should be use if you like to continue the conversation with the same id. It's required if you would like to use context and be able to answer on follow-up questions. If you don't pass the chat id a new conversation will be started for each request.
POST https://v2.ebbot.app/api/webhooks/:webhookid
Request Body
chatId
string
To continue on an existing conversation
type
string
The type of the message
value
string
The message to be sent
{
"request_id": "197d7397-bf87-4740-a829-ea7251bff534",
"data": {
"chatId": "1613384238.420.50c9b6c7-96b6-4794-b09f-3ac7ae27c598",
"sandbox": false,
"scenario": {
"id": "e67494b0-6c9c-11eb-aed8-d37ca2e276ae_e881fbe7-792a-479b-8cfd-848f91120e9c",
"name": "generalcatchall"
},
"answers": [
{
"id": "c780c560-c191-4368-924c-57a491dc1748",
"name": "generalcatchallask",
"bot_id": "ebmjx2zgfh06t4sxtxko6dcst66w4q",
"botId": "ebmjx2zgfh06t4sxtxko6dcst66w4q",
"companyId": "eb8ag1gmiktma952j949arkwu6l93v",
"parameters": {},
"db": {},
"conversation": {},
"customer_info": {
"first_name": "Reluctant",
"last_name": "Snake"
},
"chatId": "1613384238.420.50c9b6c7-96b6-4794-b09f-3ac7ae27c598",
"sender": "user",
"type": "url",
"value": {
"description": "Would you like to talk with a human agent?",
"urls": [
{
"id": "1652c631-a7f5-45a2-a84f-072809631208",
"label": "Yes",
"type": "scenario",
"next": {
"scenario": "e656fa90-6c9c-11eb-aed8-d37ca2e276ae_29029c56-4b82-454e-ad75-12445beae6c4"
}
},
{
"id": "ae5f4cd7-9734-4369-b8c9-dd5ca476e5af",
"label": "No",
"type": "scenario"
}
]
}
}
]
},
"success": true
}Example request
Example response
Set a variable
If you have triggered a scenario that contains buttons with variables you set the type to variable and then pass the clicked variable button to the value property.
Make transition
If you have a triggered scenario that contains buttons with a transition to another scenario you have to send the request with type scenario. You either link to the top of the scenario by passing the scenario id or link to a state in that scenario by adding the state id.
Outgoing webhooks
Outgoing webhooks allows you to subscribe to certain events in the conversation. This is useful if you would like to add triggers on your side based on things happening in the conversation. It's also useful if you would like to keep track of conversations in real time.
Head to the webhook page in the integration section on the left sided menu and click on add and then click on outgoing as a type. Once you have done so you have to select the topics that you would like to subscribe to.
Overview
Topic
Description
when the chat is created
when the chat is updated
when the conversations property in the session is updated
when the chat user entity is updated
subset of chat.message holds just the user’s messages
subset of chat.message holds just the bot’s messages
subset of chat.message holds just the agent’s messages
subset of chat.message holds just the system’s messages
handles all messages sent in the chat
when a scenario is executed
subset of chat.update holds just the status update
when the chat is closed, sends the whole chat transcript
Details
chat.create
Example:
chat.update
Example:
chat.data.update
Example:
chat.user.update
Example:
chat.user.message
Example:
chat.bot.message
Example:
chat.agent.message
Example:
chat.system.message
Example:
chat.message
Any of the chat.<sender>.message.
chat.scenario.run
Example:
chat.status.change
Example:
chat.close
Example:
Last updated
Was this helpful?

