Skip to main content

contentType and Corresponding content Description in Messages

Brief Description

  • {API_ADDRESS}/msg/send_msg API request field contentType supported message types description and detailed field description of message content.
Note

For image, voice, video, file and other message types, you need to upload the file to get the download address before sending the message.

contentType Summary

contentType ValueType Description
101Text message
102Image message
103Audio message
104Video message
105File message
106@ message
109Location message
110Custom message

content Details

  • content is a json object, different message types correspond to different json objects.

contentType=101 Text Message 📜

{
...,
"content": {
"content": "hello"
},
....
}
ParameterRequiredTypeDescription
contentYesstringSpecific content of text message

Card Message 🏷️

{
...,
"content": {
"userID":"",
"nickname":"",
"faceURL":"",
"ex":""
},
....
}
ParameterRequiredTypeDescription
userIDYesstringUser ID
nicknameYesstringUsername
faceURLYesstringUser avatar
exNostringExtension 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":""
}
},
....
}
ParameterRequiredTypeDescription
sourcePathNostringLocal path of image file
sourcePictureYesobjectOriginal image information
bigPictureYesobjectLarge image information
snapshotPictureYesobjectThumbnail information
uuidNostringUnique ID of image file
typeYesstringImage file type
sizeNointImage file size
widthYesintImage width
heightYesintImage height
urlYesstringImage download address, need to upload file first

Voice Message 🎤

{
...,
"content": {
"uuid":"",
"soundPath":"",
"sourceUrl":"",
"dataSize":0,
"duration":0,
"soundType":""
},
....
}
ParameterRequiredTypeDescription
uuidNostringUnique ID of voice file
soundPathNostringLocal path of voice file
sourceUrlYesstringVoice file download address, need to upload file first
dataSizeNointVoice file size
durationYesintVoice duration
soundTypeNostringVoice file type

Video Message 📹

{
...,
"content": {
"videoPath":"",
"videoUUID":"",
"videoUrl":"",
"videoType":"",
"videoSize":0,
"duration":0,
"snapshotPath":"",
"snapshotUUID":"",
"snapshotSize":0,
"snapshotUrl":"",
"snapshotWidth":0,
"snapshotHeight":0
},
....
}
ParameterRequiredTypeDescription
videoPathNostringLocal path of video file
videoUUIDNostringUnique ID of video file
videoUrlYesstringVideo file download address, need to upload file first
videoTypeYesstringVideo file type
videoSizeYesintVideo file size
durationYesintVideo duration
snapshotPathNostringLocal path of video cover image file
snapshotUUIDNostringUnique ID of video cover image
snapshotSizeNointSize of video cover image file
snapshotUrlYesstringVideo cover image file download address, need to upload file first
snapshotWidthYesintVideo cover image width
snapshotHeightYesintVideo cover image height

File Message 📁

{
...,
"content": {
"filePath":"",
"uuid":"",
"sourceUrl":"",
"fileName":"",
"fileSize":0,
"fileType":""
},
....
}
ParameterRequiredTypeDescription
filePathNostringLocal path of file
uuidNostringUnique ID of file
sourceUrlYesstringFile download address, need to upload file first
fileNameYesstringFile name
fileSizeYesintFile size
fileTypeNostringFile type

Emoji Message 😄

{
...,
"content":{
"index": 0,
"data": ""
},
...
}
ParameterRequiredTypeDescription
indexYesintEmoji index
dataNostringEmoji custom json data

Location Message 📍

{
...,
"content":{
"description": "",
"longitude": 0,
"latitude": 0
},
...,
}
ParameterRequiredTypeDescription
descriptionNostringLocation description
longitudeYesdoubleLongitude
latitudeYesdoubleLatitude

@ Message 📢

{
...,
"content": {
"text": "",
"atUserList": ['12312'],
"isAtSelf": false,
},
....
}
ParameterRequiredTypeDescription
textNostringMessage text content
atUserListYesarrayUser list to @
isAtSelfNobooleanWhether to @ self

Custom Message 🖌️

{
...,
"content": {
"data": "",
"description": "",
"extension": ""
},
....
}
ParameterRequiredTypeDescription
dataYesstringUser-defined message content
descriptionNostringExtended description information
extensionNostringExtension field