Message Category
Mixin Messenger supports texts, images, stickers, files and other message types. Note that bots currently only support message types with the prefix PLAIN_
.
To send images, files, and videos, you need to upload attachments and obtain attachment_id before sending.
Texts
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_TEXT",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
Stickers
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_STICKER",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"sticker_id": "UUID"
}
Images
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_IMAGE",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"attachment_id": "read From POST /attachments",
"mime_type": "image/jpeg",
"width": 1024,
"height": 1024,
"size": 1024,
"thumbnail": "base64 encoded"
}
Audios
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_AUDIO",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"attachment_id": "read From POST /attachments",
"mime_type": "audio/ogg",
"size": 1024,
"waveform": "audio waveform",
"duration":1024,
"created_at":"2021-12-17T12:51:53.252052226Z"
}
Videos
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_VIDEO",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"attachment_id": "Read From POST /attachments",
"mime_type": "video/mp4",
"width": 1024,
"height": 1024,
"size": 1024,
"duration": 60,
"thumbnail": "base64 encoded"
}
Contacts
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_CONTACT",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"user_id": "UUID"
}
Cards
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "APP_CARD",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"app_id": "7404c815-0393-4ea3-b9f2-b08efe4c72da",
"icon_url": "https://mixin.one/assets/98b586edb270556d1972112bd7985e9e.png", // deprecated
"cover_url": "https://mixin.one/assets/98b586edb270556d1972112bd7985e9e.png", // 16:10
"title": "Mixin", // 1 <= size(title) <= 36
"description": "Hello World.", // 1 <= size(description) <= 1024
"action": "https://mixin.one", // deprecated
"actions": [
{
"label": "Mixin Website",
"color": "#ABABAB",
"action": "https://mixin.one"
}
// ...
]
"shareable": true
}
Card forwarding can be prohibited by setting the shareable
field to false. This feature is supported by Mixin Messenger 0.31.0 or above, and the default value is true.
The cover_url
and actions
fields have been added to the data structure. If the data structure contains the action
field, the client will use the old card style and ignore any other parameters related to the new card style. The new card style, which includes the cover_url
and actions
fields, is supported by Mixin Messenger version 1.9.0 and above.
Files
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_DATA",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"attachment_id": "Read From POST /attachments",
"mime_type": "application/pdf",
"size": 1024,
"name": "2020-12-12.pdf"
}
Live Shows
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_LIVE",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"width": 650,
"height": 366,
"thumb_url": "https://mixin.one/logo.png",
"url": "https://mixin.one/live.m3u8"
}
Locations
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_LOCATION",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"longitude": 126.5893955829421,
"latitude": 53.47845177824066,
"name": "China",
"address": "China Beijing"
}
Posts
{
"id": "UUID" // generated by client,
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "PLAIN_POST",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
Buttons
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "APP_BUTTON_GROUP",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
[
{
"label": "Mixin Website", 1 <= size(label) <= 36
"color": "#ABABAB",
"action": "https://mixin.one"
}
... // 1 <= size(msg_buttons) <= 6
]
Transfers
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "SYSTEM_ACCOUNT_SNAPSHOT",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"type": "transfer",
"snapshot_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"opponent_id": "a465ffdb-4441-4cb9-8b45-00cf79dfbc46",
"asset_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "-10",
"trace_id": "7c67e8e8-b142-488b-80a3-61d4d29c90bf",
"memo": "hello",
"created_at": "2018-05-03T10:08:34.859542588Z"
}
Pin Messages
{
"id": "UUID",
"action": "CREATE_MESSAGE",
"params": {
"conversation_id": "UUID",
"category": "MESSAGE_PIN",
"status": "SENT",
"message_id": "UUID",
"data": "Base64 encoded data"
}
}
// data structure
{
"action": "PIN", // PIN or UNPIN
"message_ids": ["ab56be4c-5b20-41c6-a9c3-244f9a433f35","ab56be4c-5b20-41c6-a9c3-244f9a433f35"]
}