Chat Module Ingest Events
Kenkai SDK Chat Module tracks the messages and other activity events from the managed groups in order to facilitate engagement analysis.
"Required Catalog Fields"
Chat module is API usage only. To send in the data, please refer to the APIs available in Main Log Format.
List of Events
| Event Name | Type | Description |
|---|---|---|
| Message | message | Track events related to messages, including standard messages, replies, and reactions |
| Group | group | Track group-related events, e.g. user joined/left, group created/deleted, etc. |
| Receipt | receipt | Track message status events, e.g. message sent, delivered, read etc. |
Message Event
A message event indicates if a message of a certain type has been sent directly to the bot or the managed group.
Format
| Param | Usability | Format | Enum Values | Description |
|---|---|---|---|---|
| platform | REQUIRED | STRING | whatsapp, telegram, other | Source platform |
| msg_id | REQUIRED | STRING | Globally unique identifier of the message | |
| sender_type | REQUIRED | STRING | user, bot | The entity type who sent this message |
| sender_id | REQUIRED | STRING | Globally unique identifier of the sender of this message | |
| recipient_type | REQUIRED | STRING | user, group | The entity type who received this message |
| recipient_id | OPTIONAL | STRING | Globally unique identifier of the receiver of this message | |
| parent_msg_id | OPTIONAL | STRING | The identifier of the previous message in the reply chain | |
| type | REQUIRED | STRING | text, audio, document, image, video, sticker, contact, poll, reaction | Type of the message's content |
| content fields | REQUIRED | STRING | Content values added directly in ctx as primitive key-value pairs. For example, text, mime_type, base64, url, or emoji, prefix with body_. |
Usage
- JSON type=`text`
- JSON type=`audio`
- JSON type=`document`
- JSON type=`image`
- JSON type=`reaction`
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "message",
"property": "text",
"ctx": {
"platform": "whatsapp",
"msg_id": "3c6b469b-ef05-492d-988c-add03cf260de",
"sender_type": "bot",
"sender_id": "913c37fd-341b-42d5-9814-0a061c45617e",
"recipient_type": "user",
"recipient_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270",
"type": "text",
"body_text": "'Lorem ipsum' on the docs page! 🚀"
}
}
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "message",
"property": "audio",
"ctx": {
"platform": "whatsapp",
"msg_id": "3c6b469b-ef05-492d-988c-add03cf260de",
"sender_type": "bot",
"sender_id": "913c37fd-341b-42d5-9814-0a061c45617e",
"recipient_type": "user",
"recipient_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270",
"type": "audio",
"body_sha256": "1474ee4302163ef8016e9ec0dc6f2dc1f387fcd285797f3b1a3eeefca3d2e148",
"body_mime_type": "audio/mpeg",
"body_base64": "/+MYxAAAAANIAAAAAExBTUUzLjk4L..."
}
}
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "message",
"property": "document",
"ctx": {
"platform": "whatsapp",
"msg_id": "3c6b469b-ef05-492d-988c-add03cf260de",
"sender_type": "bot",
"sender_id": "913c37fd-341b-42d5-9814-0a061c45617e",
"recipient_type": "user",
"recipient_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270",
"type": "document",
"body_sha256": "1474ee4302163ef8016e9ec0dc6f2dc1f387fcd285797f3b1a3eeefca3d2e148",
"body_mime_type": "application/pdf",
"body_base64": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9UeXBlL1BhZ2UvUG..."
}
}
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "message",
"property": "image",
"ctx": {
"platform": "whatsapp",
"msg_id": "dba92739-0d4f-49bf-9bd4-0f2116d49221",
"sender_type": "bot",
"sender_id": "913c37fd-341b-42d5-9814-0a061c45617e",
"recipient_type": "user",
"recipient_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270",
"parent_msg_id": "3c6b469b-ef05-492d-988c-add03cf260de",
"type": "image",
"body_sha256": "1474ee4302163ef8016e9ec0dc6f2dc1f387fcd285797f3b1a3eeefca3d2e148",
"body_caption": "A variety of emoji as they appear on Google's Noto Color Emoji set as of 2024",
"body_url": "https://upload.wikimedia.org/wikipedia/commons/5/5d/Noto_Color_Emoji_From_Each_Unicode_Emoji_Category.jpg",
"body_mime_type": "image/jpeg",
"body_base64": "/9j/4Rk8RXhpZgAATU0AKgAAAAgABw..."
}
}
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "message",
"property": "reaction",
"ctx": {
"platform": "whatsapp",
"msg_id": "9dfe8d1f-8821-4df7-8a78-d9698e247a62",
"sender_type": "bot",
"sender_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270",
"recipient_type": "user",
"parent_msg_id": "3c6b469b-ef05-492d-988c-add03cf260de",
"type": "reaction",
"body_emoji": "\uD83E\uDD17"
}
}
Group Event
A group event reflects the members of a managed chat group.
Format
| Param | Usability | Format | Enum Values | Description |
|---|---|---|---|---|
| group_id | REQUIRED | STRING | Globally unique identifier of the group | |
| type | REQUIRED | STRING | join, leave, remove, create, update, delete | Group management event type |
| member_type | OPTIONAL | STRING | user, bot | The type of the member this event is concerned with |
| member_id | OPTIONAL | STRING | Globally unique identifier of a member | |
| group_name | OPTIONAL | STRING | The name of the group | |
| description | OPTIONAL | STRING | The description of the group |
- JSON type=`join`
- JSON type=`create`
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "group",
"property": "join",
"ctx": {
"type": "join",
"group_id": "4bbaf4a2-1136-4888-ba9f-1e205ea1bed9",
"member_type": "user",
"member_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270"
}
}
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "group",
"property": "create",
"ctx": {
"type": "create",
"group_id": "4bbaf4a2-1136-4888-ba9f-1e205ea1bed9",
"group_name": "Ceci n'est pas un lorem ipsum dolor",
"description": "Sightings of 'lorem ipsum' in the wild"
}
}
Receipt Event
An event reflecting change in the status of a message.
Format
| Param | Usability | Format | Enum Values | Description |
|---|---|---|---|---|
| msg_id | REQUIRED | STRING | Globally unique identifier of the message | |
| type | REQUIRED | STRING | sent, failed, deleted, delivered, read | Type of the message receipt |
| member_id | OPTIONAL | STRING | Globally unique identifier of a member who generated this receipt |
"Message Delivery Receipts"
Some platforms may even send receipts of message delivery apart from read receipts
- JSON type=`sent`
- JSON type=`read`
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "receipt",
"property": "sent",
"ctx": {
"type": "sent",
"msg_id": "dba92739-0d4f-49bf-9bd4-0f2116d49221"
}
}
{
"time": "2024-02-13T15:09:20.000Z",
"__ol": true,
"name": "receipt",
"property": "read",
"ctx": {
"type": "read",
"msg_id": "3c6b469b-ef05-492d-988c-add03cf260de",
"member_id": "1e7c1a8b-c291-48df-9ad2-55aecd684270"
}
}