Message Detailed Type Description Document
ContentType
Brief Description
- Description of message types supported by the contentType field in the administrator message sending and detailed field descriptions of the message content.
ContentType Message Type Description
ContentType Value | Type Description |
---|---|
101 | Text message |
102 | Image message |
103 | Audio message |
104 | Video message |
105 | File message |
106 | @ message |
109 | Location message |
110 | Custom message |
1400 | System notification message |
Specific Content
- The content inside is a specific json object; different message types are different json objects.
Text Message
{
...,
"content": {
"content": "nihao"
},
....
}
Parameter | Required | Type | Description |
---|---|---|---|
content | Yes | string | Specific content of the text message |
Business Card Message
{
...,
"content": {
"userID":"",
"nickname":"",
"faceURL":"",
"ex":""
},
....
}
Parameter | Required | Type | Description |
---|---|---|---|
userID | Yes | string | User ID |
nickname | Yes | string | Username |
faceURL | Yes | string | User avatar |
ex | No | string | Extended field |
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 Name | Required | Type | Description |
---|---|---|---|
sourcePath | No | string | Full path of the image file on the local machine |
sourcePicture | Yes | object | Original image information |
bigPicture | Yes | object | Large image information |
snapshotPicture | Yes | object | Thumbnail information |
uuid | No | string | Unique ID of the image file |
type | Yes | string | Image file type |
size | No | int | Image file size |
width | Yes | int | Image width |
height | Yes | int | Image height |
url | Yes | string | Image download URL |
Audio Message
{
...,
"content": {
"uuid":"",
"soundPath":"",
"sourceUrl":"",
"dataSize":0,
"duration":0,
"soundType":""
},
....
}
Parameter | Required | Type | Description |
---|---|---|---|
uuid | No | string | Unique ID of the audio file |
soundPath | No | string | Local path of the audio file |
sourceUrl | Yes | string | Audio file download URL |
dataSize | No | int | Audio file size |
duration | Yes | int | Audio 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 Name | Required | Type | Description |
---|---|---|---|
videoPath | No | string | Local path of the video file |
videoUUID | No | string | Unique ID of the video file |
videoUrl | No | string | Video file download URL |
videoType | Yes | string | Video file type |
videoSize | Yes | int | Video file size |
duration | Yes | int | Video duration |
snapshotPath | No | string | Local path of the video thumbnail image file |
snapshotUUID | No | string | Unique ID of the video thumbnail image file |
snapshotSize | No | int | Video thumbnail image file size |
snapshotUrl | Yes | string | Video thumbnail image file download URL |
snapshotWidth | Yes | int | Video thumbnail image width |
snapshotHeight | Yes | int | Video thumbnail image 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 | File download URL |
fileName | Yes | string | File name |
fileSize | Yes | int | File size |
fileType | No | string | File type |
Emoticon Message
{
"index": 0,
"data": ""
}
Parameter | Required | Type | Description |
---|---|---|---|
index | Yes | int | Emoticon index |
data | No | string | Custom json data of emoticon |
@ Message
{
...,
"content": {
"text": "",
"atUserList": ['12312'],
"isAtSelf": false,
},
....
}
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
text | 否 | json string | message |
atUserList | 是 | json string[] | @usersId list |
isAtSelf | 否 | json string | wheter @ slef |
Location Message
{
"description": "",
"longitude": 0,
"latitude": 0
}
Parameter | Required | Type | Description |
---|---|---|---|
description | No | string | Location description |
longitude | Yes | double | Longitude |
latitude | Yes | double | Latitude |
Custom Message
{
...,
"content": {
"data": "",
"description": "",
"extension": ""
},
....
}
Parameter | Required | Type | Description |
---|---|---|---|
data | Yes | json string | Custom json object converted to string |
description | No | json string | Extension description information as a json object converted to string, optional use |
extension | No | json string | Extension field, currently not used |
System Notification Message
As a special type of custom notification message, the system notification message will generate an independent conversation on the client side with a fixed conversation type of 4. The sender ID must be one of the administrator IDs configured in the backend config file.
{
...,
"content": {
{"content": {
"notificationName": "Document Management",
"notificationFaceURL": "http://www.head1.com",
"notificationType": 1,
"text": "Hello everyone, today is...",
"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 for onboarding notifications, 2 for offboarding notifications, etc. |
text | Yes | string | Notification main content |
externalUrl | No | string | The URL to redirect to when the notification is clicked (if left blank, no redirection occurs) |
mixType | Yes | int | Notification mixed type 0: Text only 1: Text + Image 2: Text + Video 3: Text + File 4: Text + Audio 5: Text + Audio + Image |
pictureElem | No | object | Image element |
sourcePicture | No | object | Original picture |
bigPicture | No | object | Large picture |
snapshotPicture | No | object | Thumbnail |
soundElem | No | object | Audio element |
videoElem | No | object | Video element |
fileElem | No | object | File element |
ex | No | string | Extended field |