Message

Update time: 2023/09/25 01: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:

httpPOST /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:

curlcurl -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.

NameTypeRequiredDescription
eventTypeIntegerYesSee types of third-party callback events, including: Peer-to-peer messages, team messages, chat room messages, and superteam messages
fromAccountStringYesUser account of the message sender
fromNickStringNoSender profile name
fromClientTypeStringYesSending client type: AOS、IOS、PC、WINPHONE、WEB、REST
fromDeviceIdStringYesSending device id
toStringYesIf 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
msgTimestampStringYesMessage sending time
msgTypeStringYesTEXT: 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
fromClientIpStringNoClient IP address of message sender
fromClientPortStringNoClient port number of message sender
msgidClientStringNoClient message Id
bodyStringNoContent
attachStringNoMessage attachment
extStringNoMessage 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:

httpPOST /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:

curlcurl -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:

javaNot every field in the callback message will necessarily be copied. Please pay attention to the nulling of each field.
NameTypeRequiredDescription
eventTypeIntegerYesValue is 35, which indicates message recall callback
fromAccountStringYesOperator account
fromDeviceIdStringYesOperator device id
fromClientTypeStringYesOperator client type: AOS、IOS、PC、WINPHONE、WEB、REST
fromClientIpStringNoOperator's client IP address
fromClientPortStringNoOperator's client port number
msgFromAccidStringYesSender of the recalled message
msgIdLongYesMessage ID (server ID) of the recalled message
timeLongYesSending time of the recalled message
opeTypeintYes7 indicates peer-to-peer message recall, 8 indicates team message recall
toAccountStringYesMessage recipient accid, or tid of the team
msgidClientStringNoMessage ID (on client side) of the recalled message
msgStringNoMessage recall postscript
attachStringNoMessage recall extension field
timestampStringYesOperation time, string type
Was this page helpful?
Yes
No
  • Session message callback
  • 1.1 HTTP example:
  • 1.2 cURL example:
  • 1.3 JSON field in message body:
  • Callback - recall a message
  • 31.1 HTTP example:
  • 31.2 cURL example:
  • 31.3 JSON field in message body: