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
Header Name | Example Value | Optional | Type | Description |
---|---|---|---|---|
operationID | 1646445464564 | No | string | operationID for global link tracking |
token | eyJhbxxxx3Xs | No | string | Admin token |
Request Parameter Example
{
"sendID": "openIMAdmin",
"recvID": "2839678182",
...
}
Field Name | Optional | Type | Description |
---|---|---|---|
sendID | No | string | Sender ID (APP admin ID or user ID) |
recvID | Yes | string | Recipient ID, required for sessionType 1 or 4; leave empty for group chat |
groupID | Yes | string | Group ID, required for sessionType 2 or 3; leave empty for individual chat |
senderNickname | Yes | string | Sender's nickname |
senderFaceURL | Yes | string | Sender's avatar URL |
senderPlatformID | Yes | int | Sender's platform number, input when simulating user sending. Enumerations: 1: IOS, 2: Android, etc. |
content | No | object | Specific message content, internally a json object. For detailed fields of other messages, refer to Message Type Format Description document |
contentType | No | int | Message Type |
sessionType | No | int | Conversation type, 1: Individual chat, 3: Group chat, 4: System notification |
isOnlineOnly | Yes | boolean | Message can only be received if the recipient is online, otherwise it will be lost |
notOfflinePush | Yes | boolean | Do not push offline |
sendTime | Yes | int | Message sending time, fill in only when importing messages, in milliseconds |
offlinePushInfo | Yes | object | Details 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 Name | Type | Description |
---|---|---|
errCode | int | Error code, 0 indicates success |
errMsg | string | Brief error information, empty if no error |
errDlt | errDlt | Detailed error information |
data | object | General data object, see structure below |
serverMsgID | string | Server message ID, a reserved field |
clientMsgID | string | Client message ID, this ID is the unique ID of the message |
sendTime | int | Message sending time |
Failed Response Example
{
"errCode": 1004,
...
}
Failed Response Parameter Description
Parameter Name | Type | Description |
---|---|---|
errCode | int | Error code, see global error code documentation for details |
errMsg | string | Brief error information |
errDlt | errDlt | Detailed error information |