Instant Messaging
Message
Update time: 2023/09/25 09:38:35
Session message callback
-
Example - session message request:
1.1. HTTP example
1.2. cURL example
1.3. JSON field in message body
1.1 HTTP example:
POST /receiveMsg.action HTTP/1.1
Host: yunxinservice.com.cn
AppKey: 158983881e092b052194d219453d6542
CurTime: 1541583920979
MD5: e89c284a5ad9a76b3176e23108920f81
CheckSum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1
Content-Type: application/json
Cache-Control: no-cache
{"body":"123456","eventType":1,"fromAccount":"000266","fromClientType":"WEB","fromDeviceId":"617715aa8579db03f0cf054c199cc71b","fromNick":"yj000266","msgTimestamp":"1541560157286","msgType":"TEXT","msgidClient":"","to":"005877","fromClientIp":"115.211.51.45","fromClientPort":"56802"}
1.2 cURL example:
curl -X POST \
http://yunxinservice.com.cn/receiveMsg.action \
-H 'appkey: 158983881e092b052194d219453d6542' \
-H 'cache-control: no-cache' \
-H 'checksum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1' \
-H 'content-type: application/json' \
-H 'curtime: 1541583920979' \
-H 'md5: e89c284a5ad9a76b3176e23108920f81' \
-d '{"body":"123456","eventType":1,"fromAccount":"000266","fromClientType":"WEB","fromDeviceId":"617715aa8579db03f0cf054c199cc71b","fromNick":"yj000266","msgTimestamp":"1541560157286","msgType":"TEXT","msgidClient":"","to":"005877","fromClientIp":"115.211.51.45","fromClientPort":"56802"}'
1.3 JSON field in message body:
Not every field in the callback message will necessarily be copied. Please pay attention to the nulling of each field.
Note: For chat room messages, the body is empty and the text content, picture content. are carried in attach.
Name | Type | Required | Description |
---|---|---|---|
eventType | Integer | Yes | See types of third-party callback events, including: Peer-to-peer messages, team messages, chat room messages, and superteam messages |
fromAccount | String | Yes | User account of the message sender |
fromNick | String | No | Sender profile name |
fromClientType | String | Yes | Sending client type: AOS、IOS、PC、WINPHONE、WEB、REST |
fromDeviceId | String | Yes | Sending device id |
to | String | Yes | If eventType is 1, then to is the user account of message recipient, string type If eventType is 2, then to is tid (team id), can be converted to Long data type If eventType is 6, then to is roomid (chat room id), can be converted to Long data type If eventType is 22, then to is tid (Superteam id), can be converted to Long data type |
msgTimestamp | String | Yes | Message sending time |
msgType | String | Yes | TEXT: text message PICTURE: image message AUDIO: voice message VIDEO: video message LOCATION: geographical location NOTIFICATION: notification FILE: file message TIPS: alert message CUSTOM: custom message |
fromClientIp | String | No | Client IP address of message sender |
fromClientPort | String | No | Client port number of message sender |
msgidClient | String | No | Client message Id |
body | String | No | Content |
attach | String | No | Message attachment |
ext | String | No | Message extension field |
Callback - recall a message
-
Example - request of recalling a message
31.1. HTTP example
31.2. cURL example
31.3. JSON field in message body
31.1 HTTP example:
POST /receiveMsg.action HTTP/1.1
Host: yunxinservice.com.cn
AppKey: 158983881e092b052194d219453d6542
CurTime: 1541583920979
MD5: e89c284a5ad9a76b3176e23108920f81
CheckSum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1
Content-Type: application/json
Cache-Control: no-cache
{"eventType":35,"fromAccount":"wm1","fromClientIp":"36.18.111.225","fromClientPort":"39632","fromClientType":"AOS","fromDeviceId":"ef6b789c-3079-463b-a52b-4924ae539e01","msgFromAccid":"wm1","msgId":184409700039655569,"msgidClient":"b897b26234d246858031291f12bc498d","opeType":8,"time":1590482455336,"timestamp":"1590482457381","toAccount":"2747918666"}
31.2 cURL example:
curl -X POST \
http://yunxinservice.com.cn/receiveMsg.action \
-H 'appkey: 158983881e092b052194d219453d6542' \
-H 'cache-control: no-cache' \
-H 'checksum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1' \
-H 'content-type: application/json' \
-H 'curtime: 1541583920979' \
-H 'md5: e89c284a5ad9a76b3176e23108920f81' \
-d '{"eventType":35,"fromAccount":"wm1","fromClientIp":"36.18.111.225","fromClientPort":"39632","fromClientType":"AOS","fromDeviceId":"ef6b789c-3079-463b-a52b-4924ae539e01","msgFromAccid":"wm1","msgId":184409700039655569,"msgidClient":"b897b26234d246858031291f12bc498d","opeType":8,"time":1590482455336,"timestamp":"1590482457381","toAccount":"2747918666"}'
31.3 JSON field in message body:
Not every field in the callback message will necessarily be copied. Please pay attention to the nulling of each field.
Name | Type | Required | Description |
---|---|---|---|
eventType | Integer | Yes | Value is 35, which indicates message recall callback |
fromAccount | String | Yes | Operator account |
fromDeviceId | String | Yes | Operator device id |
fromClientType | String | Yes | Operator client type: AOS、IOS、PC、WINPHONE、WEB、REST |
fromClientIp | String | No | Operator's client IP address |
fromClientPort | String | No | Operator's client port number |
msgFromAccid | String | Yes | Sender of the recalled message |
msgId | Long | Yes | Message ID (server ID) of the recalled message |
time | Long | Yes | Sending time of the recalled message |
opeType | int | Yes | 7 indicates peer-to-peer message recall, 8 indicates team message recall |
toAccount | String | Yes | Message recipient accid, or tid of the team |
msgidClient | String | No | Message ID (on client side) of the recalled message |
msg | String | No | Message recall postscript |
attach | String | No | Message recall extension field |
timestamp | String | Yes | Operation time, string type |
Was this topic helpful?
Yes
No