This event is fired when a contact sends a message to your channel. Request body contains channel type on which the event was handled as well as id of the contact. Different type of messages can be received based on channel.type
.
{
"event": "message_received",
"timestamp": "2016-10-06T13:42:48Z",
"data": {
"id": "{{MESSAGE_ID}}",
"channel": {
"id": "{{CHANNEL_ID}}",
"type": "{{CHANNEL_TYPE}}",
"name": "{{CHANNEL_NAME}}"
},
"contact": {
"id": "{{CONTACT_ID}}"
},
"content": {
"payload": "What's the weather today?",
"type": "text"
},
"nlp": {
"intents": [
{
"confidence": 0.99847021852548,
"id": "weather"
}
],
"native_data": {...}
},
}
}
Parameter | Type | Description |
---|---|---|
data | object | Object representing message received. Different type of messages can be received (text, image, etc.). The structure matches Send Message response body except for the nlp key (see below). This key will be present only for received text messages on channels with NLP connected. |
Natural Language Processing (NLP)
If there's an NLP connected to your channel, then your Message Received webhook will contain an nlp
key with the result provided by the NLP service. Since different NLP services provide different extra capabilities and parameters beyond simple intent/entity extraction, we also include full JSON response from the service.
Parameter | Type | Description |
---|---|---|
nlp.intents | array of objects | List of intents ordered by confidence score. |
nlp.intents[].id | string | Name (or other unique identifier) of the intent. |
nlp.intents[].confidence | number | Confidence score of the intent. |
nlp.native_data | object | Full unmodified JSON response as returned by the NLP service. For more information, please refer to the documentation of the service: • Wit.ai • Watson |