Integration Settings

The integration settings page of your chatbot allows you to change or review all values related to statistica integrations.

Events Webhook URL

In the Events Webhook field you can specify a webhook URL that will receive a configurable number of events, triggered by your bot.

Events are not pushed to the URL in real-time but are grouped and sent once about every 30 minutes.

If you are looking into building a real-time system based on chat messages being exchanged by your bot, the Custom Channel would be the perfect fit.

Your custom webhook will receive a payload containing the event associated with the flags above. Events are not grouped: each event will be delivered trough a specific call to your custom webhook.

You can find below some examples you may expect:

Xenioo/Operator Message

{
    "Type": 0,
    "ItemType": "Text",
    "Data": "Hey you, I'm your chatbot!",
    "Date": "2019-07-10T15:47:58.580873+00:00",
    "BotToken": "...",
    "AccountName": "Matelab Srl",
    "ConversationId": "...",
    "UserName":"conversation user name",
    "Channel": "TelegramChannel"
}

User Message

{
    "Type": 1,
    "Data": "Hello there!",
    "Date": "2019-07-10T15:47:58.5750058+00:00",
    "BotToken": "...",
    "AccountName": "Matelab Srl",
    "ConversationId": "...",
    "UserName":"conversation user name",
    "Channel": "TelegramChannel"
}

Intent Update

{
    "Type":3,
    "BotToken": "...",
    "AccountName": "Matelab Srl",
    "Name":"Intent Name",
    "Key":"Intent Key"
}

NLP Missed Text

{
    "Type":7,
    "BotToken": "...",
    "AccountName": "Matelab Srl",
    "Text":"Missed AI Text"
}

Each array entry can have the following fields:

Field

Description

Type

The type of entry, according to the table below.

ItemType

The item specific visual type.

ItemSubType

The subtype of the item specific visual type.

Data

The content of the message. It can be either the text sent by the user or the message sent by the chatbot. If the user clicks a button this field will contain both its text and its payload.

Date

The exact date of the message

BotToken

The unique bot token associated to the chatbot generating the item

AccountName

The full name of the account generating the item

ConversationId

The Id of the conversation associated to this item

Channel

The name of the channel that generated the item

Text

The text that was not detected by Xenioo AI

Name

The name of the Intent or Entity related to the event

Key

The key of the Intent or Entity related to the event

Message type can have one of the following values:

Value

Type

0

Chatbot chat message

1

User chat message

2

A conversation error has occurred

3

An intent was updated

4

An intent was deleted

5

An entity was updated

6

An entity was deleted

7

A user chat message was not detected by Xenioo Automatic Intent Redirection

8

New user connected to the chatbot. The user has never contacted the chatbot before (or has been forgotten).

9

A user returned to talk with the chatbot. This event is fired only once every 24 hours even if the user comes back multiple times during the day.

10

Take Over happened

11

Hand Over happened

12

The conversation hit a fallback interaction

13

The conversation hit a wrong question reply

The expected Webhook reply must be a standard HTTP 200 OK. The reply body can be empty. If your Webhook fails to correctly reply to a request or is unreachable for more than 10 times Xenioo will stop any further call and alert your account with an e-mail. To re-enable the Webhook simply save again the chatbot settings and publish again your bot.

The Xenioo call will contain an authorization header with a Bearer equal to the current bot API Secret. In your own integration you can check for the correctness of the value to make sure that the incoming call is generated by Xenioo.

Each call to your hook will count as an additional outgoing message. Xenioo will consider one single outgoing message regardless of the amount of in and out messages sent to the hook in each single push. So for example if a hook call contains 30 messages that will still count as only one additional outgoing message.

The specified Webhook is ignored if your bot is running under a free plan.

Security

Each call to you custom Webhook will contain an Authorization header set to the source bot API Secret. Please ensure that your endpoint correctly filters any request that doesn't contain the correct value.

Last updated