Messages Events

Page describing the events generated when a user sends a message.

The following configuration is applicable in instances where message handling is overseen by external providers rather than by Jelou.

When a user sends a message to the bot and the user is in "manual" state you get notify by the webhook that is set. The different types of payloads generated by user sending a message are the following:

Text

The request payload when a user sends a text message.

{
    "messageId": "<messageId>",
    "bubble": {
        "type": "text",
        "text": "<message>"
    },
    "names": "<username>",
    "userId": "<userId>",
    "botId": "<botId>",
    "received": <timeInMilis>,
    "status": "created",
    "owner": "user"
}

Image

The request payload when a user sends a image message.

{
    "messageId": "<messageId>",
    "bubble": {
        "type": "image",
        "text": "<text>",
        "mediaUrl": "<mediaUrl>",
        "mediaType": "<mediaType>",
        "mediaSize": <mediaSize>
    },
    "names": "<username>",
    "userId": "<userId>",
    "botId": "<botId>",
    "received": <timeInMilis>,
    "status": "created",
    "owner": "user"
}

Warning: The parameter bubble.text is not available if the user doesn't send text attach to the image to the bot.

Location

The request payload when a user sends a location message.

{
    "messageId": "<messageId>",
    "bubble": {
        "type": "location",
        "text": "Location shared:\nhttps://maps.google.com/maps?q=<latitude>,<longitude>",
        "coordinates": {
            "lat": <latitude>,
            "long": <longitude>
        }
    },
    "names": "<username>",
    "userId": "<userId>",
    "botId": "<botId>",
    "received": <timeInMillis>,
    "status": "created",
    "owner": "user"
}

File

The request payload when a user sends a file message.

{
    "messageId": "<messageId>",
    "bubble": {
        "type": "file",
        "mediaUrl": "<mediaUrl>",
        "mediaType": "<mediaType>",
        "mediaSize": <mediaSize>
    },
    "names": "<names>",
    "userId": "<userId>",
    "botId": "<botId>",
    "received": <timeInMillis>,
    "status": "created",
    "owner": "user"
}

Last updated