Platform API
Before sending a one-to-one message
Use this callback for content moderation, policy enforcement, or field validation before a one-to-one message is sent.
HTTP request
POST {WEBHOOK_ADDRESS}/callbackBeforeSendSingleMsgCommandRequest body
| Property | Type | Description |
|---|---|---|
| callbackCommand | string | callbackBeforeSendSingleMsgCommand. |
| sendID | string | Sender user ID. |
| recvID | string | Recipient user ID. |
| serverMsgID | string | OpenIM server message ID. |
| clientMsgID | string | Client message ID. |
| operationID | string | OpenIM operation trace ID. |
| senderPlatformID | int | Sender platform ID. |
| senderNickname | string | Sender nickname. |
| sessionType | int | Conversation type. |
| msgFrom | int | Message source. |
| contentType | int | Message content type. |
| status | int | Message status. |
| sendTime | int | Send time in milliseconds. |
| createTime | int | Creation time in milliseconds. |
| content | string | JSON string for the selected message content type. |
| seq | int | Message sequence number. |
| atUserList | string[] | Mentioned user IDs. |
| faceURL | string | Sender avatar URL. |
| ex | string | Extension data. |
| keyVersion Enterprise | int | Message encryption key version. |
Response
Return the common before-event response from Webhooks overview. Use nextCode: 1 to reject the message.
Processing rules
- Configuration key:
beforeSendSingleMsg. - OpenIM waits synchronously; timeout behavior follows
failedContinue.
Was this page helpful?