BeforeSendMessage
消息发送前。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| AppId | Int | 000000 | 应用的唯一标志 |
| InboxType | Int | 0 | 信箱,用于逻辑隔离 |
| MessageBody | MessageBody | / | 消息详情 |
| RefMsgInfo | RefMsgInfo | / | 引用消息详情 |
| ToId | Int | 000010 |
|
MessageBody
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| Content | String | Your_Content | 消息内容 |
| ConversationShortId | Int | 000001 | 会话 ID |
| ConversationType | Int | 1 | 会话类型
|
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段 |
| MsgType | Int | 10001 | 消息类型。
|
| Sender | Int | 000010 | 消息发送人 UserId |
| MessageId | Int | 7157538953100462124 | 消息 ID |
RefMsgInfo
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| Content | String | Your_Content | 被引用的消息内容 |
| Hint | String | [图片] | 消息引用时展示的文本内容 |
| InvisibleUsers | Array of Int | [111111] | 消息不可见群成员列表。 |
| VisibleUsers | Array of Int | [111111] | 消息可见群成员列表 |
| ReferenceMessageId | Int | 7157538953100462124 | 消息 ID |
| ReferenceMessageType | Int | 10001 | 消息类型。
|
| Status | Int | 0 | 消息状态,取值为0,表示消息可见。 |
{
"AppId": 000000,
"InboxType": 0,
"MessageBody": {
"Content": "Your_Content",
"ConversationShortId": 000001,
"ConversationType": 2,
"Ext": {
"key":"value"
},
"MsgType": 10001,
"Sender": 000010,
"MessageId": 7157538953100462124
},
"RefMsgInfo": {
"Content": "Your_Content",
"Hint": "[图片]",
"InvisibleUsers": [],
"VisibleUsers": [],
"ReferenceMessageId": 7172170746108625159,
"ReferenceMessageType": 10001,
"Status": 0
},
"ToId": 000011
}
json若想修改 IM 服务端传入的Ext,Content、InvisibleUsers 或 VisibleUsers 的值,可在 Response 中传入,否则这些值均不传或传 null。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
| MessageBody | MessageBody | / | 消息详情 |
MessageBody
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段。若 EvenData 与 Response 均传入该值,若 key 值相同,最终则以Response 传入为准。若 key 值不同,则最终合并展示。 |
| Content | String | Your_Content | 消息内容 |
| InvisibleUsers | Array of Int | [111111] | 消息不可见群成员列表。 |
| VisibleUsers | Array of Int | [111111] | 消息可见群成员列表 |
{
"CheckCode":0,
"CheckMessage":""
"MessageBody":{
"Ext":{},
"Content":"",
"VisibleUsers":[],
"InVisibleUsers":[]
}
}
jsonBeforeCreateConversation
创建群聊前。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| AppId | Int | 000000 | 应用的唯一标志 |
| Description | String | Your_Description | 群描述 |
| AvatarUrl | String | http://xxx.com | 群头像 url |
| Name | String | Conversation | 群名 |
| InboxType | Int | 0 | 信箱,用于逻辑隔离 |
| ParticipantUserIds | Array of Int | [10001,10002] | 群成员 ID |
| OwnerUserId | Int | 100001 | 群主 UserId |
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段 |
{
"AppId": 000000,
"Description": "Your_Description",
"AvatarUrl": "http://xxx.com",
"Name": "Conversation",
"InboxType": 0,
"ParticipantUserIds": [
10001,
10002
],
"OwnerUserId": 10001,
"Ext": {
"key":"value"
}
}
json若想修改 IM 服务端传入的ValidParticipantUserIds,InValidParticipantUserIds、Name 、AvatarUrl 、Description 或 Ext 的值,可在 Response 中传入,否则这些值均不传或传 null。
InValidParticipantUserIds 暂时无意义,但建议设置。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
| ValidParticipantUserIds | Array of Int | [10001,10002] | 合法群成员 ID |
| InValidParticipantUserIds | Array of Int | [10003,10004] | 不合法群成员 ID |
| Name | String | Conversation | 群名 |
| AvatarUrl | String | http://xxx.com | 群头像 url |
| Description | String | Your_Description | 群描述 |
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段。若 EvenData 与 Response 均传入该值,若 key 值相同,最终则以Response 传入为准。若 key 值不同,则最终合并展示。 |
{
"CheckCode": 0,
"CheckMessage": "",
"ValidParticipantUserIds":[10001,10002,10004],
"InValidParticipantUserIds":[10003],
"Name":"Newconversation",
"AvatarUrl":"http://xxx.xxx.com",
"Description":"new_Description",
"Ext": {
"key":"value"
}
}
jsonBeforeAddParticipant
添加群成员前。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| AppId | Int | 000000 | 应用的唯一标志 |
| ConversationShortId | Int | 000001 | 会话 ID |
| InboxType | Int | 0 | 信箱,用于逻辑隔离 |
| ParticipantUserIds | Array of Int | [10001,10002] | 群成员 ID |
| Operator | Int | 100001 | 操作人 UserId |
{
"AppId": 000000,
"ConversationShortId": 000001,
"InboxType": 0,
"ParticipantUserIds": [
10009
],
"Operator": 100001
}
json若想修改 IM 服务端传入的ValidParticipantUserIds 或 InValidParticipantUserIds的值,可在 Response 中传入,否则这些值均不传或传 null。
InValidParticipantUserIds 暂时无意义,但建议设置。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
| ValidParticipantUserIds | Array of Int | [10001,10002] | 合法群成员 ID |
| InValidParticipantUserIds | Array of Int | [10003,10004] | 不合法群成员 ID |
{
"CheckCode": 0,
"CheckMessage": "",
"ValidParticipantUserIds":[10010],
"InValidParticipantUserIds":[10003]
jsonBeforeCreateSingleConversation
添加群成员前。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| AppId | Int | 000000 | 应用的唯一标志 |
| OwnerUserId | Int | 10001 | 发起群聊 UserId |
| InboxType | Int | 0 | 信箱,用于逻辑隔离 |
| ParticipantUserIds | Array of Int | [10001,10002] | 群成员 ID |
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段。 |
{
"AppId": 000000,
"OwnerUserId": 10001,
"ParticipantUserIds": [
10001,
10002
]
"Ext": {
"key":"value"
}
}
json若想修改 IM 服务端传入的Ext 的值,可在 Response 中传入,否则这些值均不传或传 null。
InValidParticipantUserIds 暂时无意义,但建议设置。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段。若 EvenData 与 Response 均传入该值,若 key 值相同,最终则以Response 传入为准。若 key 值不同,则最终合并展示。 |
{
"CheckCode": 0,
"CheckMessage": "",
"Ext": {
"key":"value"
}
jsonBeforeRemoveParticipant
移除群聊用户前。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| AppId | Int | 000000 | 应用的唯一标志 |
| ConversationShortId | Int | 000001 | 会话 ID |
| ParticipantUserIds | Array of Int | [10002] | 移除群聊用户 UserId |
| Operator | Int | 100001 | 操作人 UserId |
{
"AppId": 000000,
"ConversationShortId": 000001,
"ParticipantIds": [
10002
],
"Operator": 100001
}
json若想修改 IM 服务端传入的ValidParticipantUserIds 或 InValidParticipantUserIds的值,可在 Response 中传入,否则这些值均不传或传 null。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
| ValidParticipantUserIds | Array of Int | [10002] | 移除群聊用户 UserId |
| InValidParticipantUserIds | Array of Int | [10003,10004] | 不合法群成员 ID。暂时无意义,但推荐设置 |
{
"CheckCode": 0,
"CheckMessage": ""
"ValidParticipantUserIds":[10002],
"InValidParticipantUserIds":[10003]
}
jsonBeforeUpdateConversation
更新群聊信息前。
若某个字段并没有修改,则
EventData中并不会出现该字段。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| AppId | Int | 000000 | 应用的唯一标志 |
| ConversationShortId | Int | 000001 | 会话 ID |
| ConversationType | Int | 1 | 会话类型。
|
| Description | String | Your_Description | 群描述 |
| AvatarUrl | String | http://xxx.com | 群头像 url |
| Name | String | Conversation | 群名 |
| Notice | String | Your_Notice | 群公告 |
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段。 |
| Operator | Int | 100001 | 操作人 UserId |
{
"AppId": 000000,
"ConversationShortId": 000001,
"ConversationType": 2,
"Description": "000001",
"AvatarUrl": http://xxx.com,
"Name": "Conversation",
"Notice": Your_Notice,
"Ext": {
"key":"value"
}
"Operator":100001
}
json若想修改 IM 服务端传入的Name、Description、AvatarUrl、Notice 或 Ext的值,可在 Response 中传入,否则这些值均不传或传 null。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
| Name | String | Conversation | 群名 |
| Description | String | Your_Description | 群描述 |
| AvatarUrl | String | http://xxx.com | 群头像 url |
| Notice | String | Your_Notice | 群公告 |
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段。若客户端与服务端均传入该值,若 key 值相同,则以服务端为准。若 key 值不同,则合并展示。 |
{
"CheckCode": 0,
"CheckMessage": ""
"Name":"New_Conversation",
"Description":"New_Description",
"AvatarUrl":"http://xxx.xxx.com",
"Notice":"New_Notice",
"Ext": {
"key":"value"
}
}
jsonBeforeUpdateParticipant
修改群成员详情前。
若某个字段并没有修改,则
EventData中并不会出现该字段。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| NickName | String | Your_NickName | 成员昵称 |
| AppId | Int | 000000 | 应用的唯一标志 |
| ConversationShortId | Int | 000001 | 会话 ID |
| ConversationType | Int | 1 | 会话类型。
|
| Operator | Int | 100001 | 操作人 UserId |
| Role | Int | 0 | 成员身份。
|
| ParticipantuserId | Int | 10001 | 修改用户 UserId |
{
"NickName": "Your_NickName",
"AppId": 000000,
"ConversationShortId": 000001,
"ConversationType": 2,
"Operator": 10002,
"Role": 2,
"ParticipantuserId": 10001
}
json| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
{
"CheckCode": 0,
"CheckMessage": ""
}
jsonBeforeUpdateSetting
修改用户对群设置前。
若某个字段并没有修改,则
EventData中并不会出现该字段。
| 参数名 | 类型 | 示例值 | 描述 |
| --- | --- | --- | --- |
| AppId | Int |000000| 应用的唯一标志 |
| ConversationShortId | Int |000001| 会话 ID |
| ConversationType | Int |1| 会话类型。|
1:单聊2:群聊
| IsMute | Bool |true|是否免打扰|
| IsSetTop | Bool |true|是否置顶|
| IsSetFavorite | Bool |true|是否收藏|
| Ext | map-key(string)-value(string) |{"key":"value"}| 会话的扩展字段。 |
| ParticipantUserId | Int|10001| 修改用户 UserId |
{
"AppId": 000000,
"ConversationShortId": 000001,
"ConversationType": 2,
"IsMute": true
"IsSetTop":true
"IsSetFavorite" : true
"Ext": {
"key":"value"
}
"ParticipantUserId": 10001
}
json若想修改 IM 服务端传入的Ext的值,可在 Response 中传入,否则这些值均不传或传 null。
| 参数名 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CheckCode | Int | 0 | 若非 0,表示发送消息失败 |
| CheckMessage | String | / | 消息发送失败原因 |
| Ext | map-key(string)-value(string) | {"key":"value"} | 会话的扩展字段。若 EvenData 与 Response 均传入该值,若 key 值相同,最终则以Response 传入为准。若 key 值不同,则最终合并展示。 |
{
"CheckCode": 0,
"CheckMessage": "",
"Ext": {
"key":"value"
}
}
json