Skip to main content

send_msg

Brief Description

  • Simulate an identity sending a message to a specified user or group, can also be used to import historical records from other platforms.

Request Method

  • post

Request URL

  • http://x.x.x.x:10002/msg/send_msg
Header NameExample ValueOptionalTypeDescription
operationID1646445464564NostringoperationID for global link tracking
tokeneyJhbxxxx3XsNostringAdmin token

Request Parameter Example

{
"sendID": "openIMAdmin",
"recvID": "2839678182",
...
}
Field NameOptionalTypeDescription
sendIDNostringSender ID (APP admin ID or user ID)
recvIDYesstringRecipient ID, required for sessionType 1 or 4; leave empty for group chat
groupIDYesstringGroup ID, required for sessionType 2 or 3; leave empty for individual chat
senderNicknameYesstringSender's nickname
senderFaceURLYesstringSender's avatar URL
senderPlatformIDYesintSender's platform number, input when simulating user sending. Enumerations: 1: IOS, 2: Android, etc.
contentNoobjectSpecific message content, internally a json object. For detailed fields of other messages, refer to Message Type Format Description document
contentTypeNointMessage Type
sessionTypeNointConversation type, 1: Individual chat, 3: Group chat, 4: System notification
isOnlineOnlyYesbooleanMessage can only be received if the recipient is online, otherwise it will be lost
notOfflinePushYesbooleanDo not push offline
sendTimeYesintMessage sending time, fill in only when importing messages, in milliseconds
offlinePushInfoYesobjectDetails of offline push; if not provided, the server's default push title will be used

... (Details for offlinePushInfo attributes) ...

Successful Response Example

{
"errCode": 0,
...
}

Successful Response Parameter Description

Parameter NameTypeDescription
errCodeintError code, 0 indicates success
errMsgstringBrief error information, empty if no error
errDlterrDltDetailed error information
dataobjectGeneral data object, see structure below
serverMsgIDstringServer message ID, a reserved field
clientMsgIDstringClient message ID, this ID is the unique ID of the message
sendTimeintMessage sending time

Failed Response Example

{
"errCode": 1004,
...
}

Failed Response Parameter Description

Parameter NameTypeDescription
errCodeintError code, see global error code documentation for details
errMsgstringBrief error information
errDlterrDltDetailed error information