Message Content Type Documentation
ContentType đâ
Overviewâ
- Explanation of supported message types for the
contentType
field in themsg/send_msg
API request, including specific fields withincontent
for each message type.
ContentType Message Type Explanationsâ
ContentType Value | Type Description |
---|---|
101 | Text Message |
102 | Image Message |
103 | Audio Message |
104 | Video Message |
105 | File Message |
106 | @ Mention Message |
109 | Location Message |
110 | Custom Message |
1400 | System Notification |
Content Details đâ
content
is a JSON object, and each message type has a unique structure.
Text Message đâ
{
"content": {
"content": "Hello"
}
}
Parameter | Required | Type | Description |
---|---|---|---|
content | Yes | string | Content of the text |
Contact Card Message đˇī¸â
{
"content": {
"userID": "",
"nickname": "",
"faceURL": "",
"ex": ""
}
}
Parameter | Required | Type | Description |
---|---|---|---|
userID | Yes | string | User ID |
nickname | Yes | string | Username |
faceURL | Yes | string | Profile URL |
ex | No | string | Extension |
Image Message đˇâ
{
"content": {
"sourcePath": "",
"sourcePicture": {
"uuid": "",
"type": "",
"size": 0,
"width": 0,
"height": 0,
"url": ""
},
"bigPicture": {
"uuid": "",
"type": "",
"size": 0,
"width": 0,
"height": 0,
"url": ""
},
"snapshotPicture": {
"uuid": "",
"type": "",
"size": 0,
"width": 0,
"height": 0,
"url": ""
}
}
}
Parameter | Required | Type | Description |
---|---|---|---|
sourcePath | No | string | Local file path |
sourcePicture | Yes | object | Original image |
bigPicture | Yes | object | Full-size image |
snapshotPicture | Yes | object | Thumbnail image |
uuid | No | string | Unique image ID |
type | Yes | string | Image type |
size | No | int | Image size |
width | Yes | int | Image width |
height | Yes | int | Image height |
url | Yes | string | Download URL |
Audio Message đ¤â
{
"content": {
"uuid": "",
"soundPath": "",
"sourceUrl": "",
"dataSize": 0,
"duration": 0,
"soundType": ""
}
}
Parameter | Required | Type | Description |
---|---|---|---|
uuid | No | string | Unique audio ID |
soundPath | No | string | Local file path |
sourceUrl | Yes | string | Download URL |
dataSize | No | int | File size |
duration | Yes | int | Duration |
soundType | No | string | Audio file type |
Video Message đšâ
{
"content": {
"videoPath": "",
"videoUUID": "",
"videoUrl": "",
"videoType": "",
"videoSize": 0,
"duration": 0,
"snapshotPath": "",
"snapshotUUID": "",
"snapshotSize": 0,
"snapshotUrl": "",
"snapshotWidth": 0,
"snapshotHeight": 0
}
}
Parameter | Required | Type | Description |
---|---|---|---|
videoPath | No | string | Local file path |
videoUUID | No | string | Unique video ID |
videoUrl | Yes | string | Download URL |
videoType | Yes | string | Video type |
videoSize | Yes | int | File size |
duration | Yes | int | Duration |
snapshotPath | No | string | Thumbnail local path |
snapshotUUID | No | string | Unique thumbnail ID |
snapshotSize | No | int | Thumbnail file size |
snapshotUrl | Yes | string | Thumbnail download URL |
snapshotWidth | Yes | int | Thumbnail width |
snapshotHeight | Yes | int | Thumbnail height |
File Message đâ
{
"content": {
"filePath": "",
"uuid": "",
"sourceUrl": "",
"fileName": "",
"fileSize": 0,
"fileType": ""
}
}
Parameter | Required | Type | Description |
---|---|---|---|
filePath | No | string | Local file path |
uuid | No | string | Unique file ID |
sourceUrl | Yes | string | Download URL |
fileName | Yes | string | File name |
fileSize | Yes | int | File size |
fileType | No | string | File type |
Emoji Message đâ
{
"content": {
"index": 0,
"data": ""
}
}
Parameter | Required | Type | Description |
---|---|---|---|
index | Yes | int | Emoji index |
data | No | string | Custom emoji JSON data |
Location Message đâ
{
"content": {
"description": "",
"longitude": 0,
"latitude": 0
}
}
Parameter | Required | Type | Description |
---|---|---|---|
description | No | string | Location text |
longitude | Yes | double | Longitude |
latitude | Yes | double | Latitude |
@ Mention Message đĸâ
{
"content": {
"text": "",
"atUserList": ["user1"],
"isAtSelf": false
}
}
Parameter | Required | Type | Description |
---|---|---|---|
text | No | string | Message text |
atUserList | Yes | array | List of users |
isAtSelf | No | boolean | Mention yourself |
Custom Message đī¸â
{
"content": {
"data": "",
"description": "",
"extension": ""
}
}
Parameter | Required | Type | Description |
---|---|---|---|
data | Yes | string | Custom message data |
description | No | string | Additional details |
extension | No | string | Extension field |
System Notification Message đĸâ
As a special custom message, system notifications create a standalone conversation with a fixed type of 4, and the sender ID is the system notification ID
userID
.
{
"content": {
"notificationName": "notification",
"notificationFaceURL": "http://example.com/avatar",
"notificationType": 1,
"text": "hello!",
"externalUrl": "",
"mixType": 0,
"pictureElem": {
"sourcePath": "",
"sourcePicture": {
"uuid": "",
"type": "",
"size": 0,
"width": 0,
"height": 0,
"url": ""
},
"bigPicture": {
"uuid": "",
"type": "",
"size": 0,
"width": 0,
"height": 0,
"url": ""
},
"snapshotPicture": {
"uuid": "",
"type": "",
"size": 0,
"width": 0,
"height": 0,
"url": ""
}
},
"soundElem": {
"uuid": "",
"soundPath": "",
"sourceUrl": "",
"dataSize": 0,
"duration": 0
},
"videoElem": {
"videoPath": "",
"videoUUID": "",
"videoUrl": "",
"videoType": "",
"videoSize": 0,
"duration": 0,
"snapshotPath": "",
"snapshotUUID": "",
"snapshotSize": 0,
"snapshotUrl": "",
"snapshotWidth": 0,
"snapshotHeight": 0
},
"fileElem": {
"filePath": "",
"uuid": "",
"sourceUrl": "",
"fileName": "",
"fileSize": 0
},
"ex": ""
}
}
Parameter | Required | Type | Description |
---|---|---|---|
notificationName | Yes | string | Notification title |
notificationFaceURL | No | string | Notification avatar URL |
notificationType | Yes | int | Notification type, e.g., 1: onboarding, 2: departure |
text | Yes | string | Notification content |
externalUrl | No | string | URL to navigate upon click |
mixType | Yes | int | Notification mix type 0: Text only 1: Text + Image 2: Text + Video 3: Text + File 4: Text + Sound 5: Text + Sound + Image |
pictureElem | No | object | Image element |
sourcePicture | No | object | Original image |
bigPicture | No | object | Large image |
snapshotPicture | No | object | Thumbnail image |
soundElem | No | object | Sound element |
videoElem | No | object | Video element |
fileElem | No | object | File element |
ex | No | string | Extension field |