Instant Messaging
Server
Getting Started
Limits
Platform Service
Webhooks
Overview
Message-related Callback
Related Callbacks of User Information
Related Callbacks of Advanced Team
Related Callbacks of Super Team
Related Callbacks of Audio and Video
Callback related to Log in
Data Sync
Data Sync Overview
Activate Data Sync
IM Session Message Delivery
Other IM Message Delivery
Audio/video/whiteboard Duration Message Delivery
Content Moderation
Overview
Best Practice
API Reference
Overview
Status Code
Account Management
Register Accounts
Refresh Token
Ban Accounts
Mute Accounts
Push Notification
Login Authentication
Messaging
Send Messages
Unsend Messages
Send Broadcast Messages
Upload Files
Delete a message
Delete a roaming message
Message history
History
Custom system notification
User Profile
User Relationship
Host User Relationship
Group
Advanced group
Supergroup
Chat room
Create a chat room
Get the URL of a chat room
Update chat room info
Edit chat room states
Set a timer to close a chat room
Manage roles
Get the member list
Manage chatbots
Manage tags
Message queues
Online Status

Message-related Callback

Update time: 2021/12/03 17:55:22

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.

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:

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.
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 topic 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: