消息抄送

消息抄送功能概述

说明

1、网易云通信服务器可以通过消息抄送功能,将消息数据实时同步给第三方开发者的服务器。`在接收数据之前,需要在网易云通信管理后台注册消息抄送数据的接收地址`;

2、抄送消息时,若开发者服务器处于离线状态或者由于其他原因导致连接不上消息接收地址,网易云通信会根据一定策略再尝试抄送一定次数,若开发者服务器仍然无法连接,默认情况下,网易云通信`将会丢弃抄送失败的消息`。若有特殊需求不能丢弃消息,请联系网易云通信商务经理;

3、考虑到网络环境的不稳定,为了确保开发者的消息接口能收到抄送的消息,网易云通信可能会重复发送同一条消息,建议开发者对所收到的消息进行一定的`去重操作`;

4、网易云通信消息抄送服务对于一条消息是否抄送成功具有`超时判定机制(超时时间为5s)`,若超时,将会尝试重新抄送一定次数。如果第三方消息接收接口在接收到消息之后,会做比较耗时的操作(例如DB入库等操作)的话,建议将该接口做成`异步机制`(例如可以将消息先存到MQ中),以免被网易云通信判定为超时;

5、在消息抄送服务中,CheckSum = sha1(AppSecret + MD5 + CurTime), 其中`AppSecret 、MD5、CurTime`均为String类型。在验证数据是否在传输过程中被篡改时,需要`计算验证MD5值是否被修改,以及计算验证CheckSum`。AppSecret值为开发者的AppSecret, MD5值为根据request body计算出来的值, 即MD5值 = md5(request body)。

6、网易云通信抄送服务需要开发者服务器在超时时间(5s)内返回HTTP 200状态码,以验证本次消息抄送是否成功。

7、[消息抄送服务第三方接口示例(JAVA)](http://bbs.netease.im/read-tid-385)

MD5值计算举例

String requestBody = "{}";
String MD5 = CheckSumBuilder.getMD5(requestBody); //参考 接口概述 -> API checksum校验 部分

CheckSum值计算举例

String AppSecret = "90u757h67n87";
String MD5 = "9894907e4ad9de4678091277509361f7";
String CurTime = "1440570500855";  ////当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
String CheckSum = CheckSumBuilder.getCheckSum(AppSecret, MD5, CurTime); //参考 接口概述 -> API checksum校验 部分

抄送消息类型

目前包含14类:

1). "eventType"="1", 表示CONVERSATION消息,即会话类型的消息(目前包括P2P聊天消息,群组聊天消息,群组操作,好友操作)

2). "eventType"="2", 表示LOGIN消息,即用户登录事件的消息

3). "eventType"="3", 表示LOGOUT消息,即用户登出事件的消息

4). "eventType"="4", 表示CHATROOM消息,即聊天室中聊天的消息

5). "eventType"="5", 表示AUDIO/VEDIO/DataTunnel消息,即汇报实时音视频通话时长、白板事件时长的消息

6). "eventType"="6", 表示音视频/白板文件存储信息,即汇报音视频/白板文件的大小、下载地址等消息

7). "eventType"="7", 表示单聊消息撤回抄送

8). "eventType"="8", 表示群聊消息撤回抄送

9). "eventType"="9", 表示CHATROOM_INOUT信息,即汇报主播或管理员进出聊天室事件消息

10). "eventType"="10", 表示ECP_CALLBACK信息,即汇报专线电话通话结束回调抄送的消息

11). "eventType"="11", 表示SMS_CALLBACK信息,即汇报短信回执抄送的消息

12). "eventType"="12", 表示SMS_REPLY信息,即汇报短信上行消息

13). "eventType"="13", 表示AVROOM_INOUT信息,即汇报用户进出音视频/白板房间的消息

14). "eventType"="14", 表示CHATROOM_QUEUE_OPERATE信息,即汇报聊天室队列操作的事件消息

会话类型消息抄送

假设第三方开发者的消息接收地址为:

http://yunxinservice.com.cn/receiveMsg.action,
以下的第三方接口均假设为此接口,不再赘述。
1. "eventType"="1"

1.1 HTTP示例:

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"attach":"thisisattach","body":"hello","convType":"PERSON","eventType":"1","fromAccount":"111","fromClientType":"IOS","fromDeviceId":"thisisfromdeviceid","fromNick":"mike","msgTimestamp":"1441977355557","msgType":"TEXT","msgidClient":"1234567","msgidServer":"3456789","resendFlag":"0","to":"222"}

1.2 cURL示例:

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"attach":"thisisattach","body":"hello","convType":"PERSON","eventType":"1","fromAccount":"111","fromClientType":"IOS","fromDeviceId":"thisisfromdeviceid","fromNick":"mike","msgTimestamp":"1441977355557","msgType":"TEXT","msgidClient":"1234567","msgidServer":"3456789","resendFlag":"0","to":"222"}' 'http://yunxinservice.com.cn/receiveMsg.action'

1.3 消息体中的JSON字段说明:

会话类型消息中,并不是每个字段都会一定抄送,请注意对各字段的判空处理。
以下为一般情况下必有的字段:
eventType、convType、tofromAccount、msgTimestamp、msgType、msgidClient、msgidServer
名称类型说明
eventType String值为1,表示是会话类型的消息
convType String会话具体类型:
PERSON(二人会话数据)、TEAM(群聊数据)、
CUSTOM_PERSON(个人自定义系统通知)、CUSTOM_TEAM(群组自定义系统通知),字符串类型
to String若convType为PERSON或CUSTOM_PERSON,则to为消息接收者的用户账号,字符串类型;
若convType为TEAM或CUSTOM_TEAM,则to为tid,即群id,可转为Long型数据
fromAccount String消息发送者的用户账号,字符串类型
fromClientType String发送客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST,字符串类型
fromDeviceId String发送设备id,字符串类型
fromNick String发送方昵称,字符串类型
msgTimestamp String消息发送时间,字符串类型
msgType String 会话具体类型PERSON、TEAM对应的通知消息类型:
TEXT、
PICTURE、
AUDIO、
VIDEO、
LOCATION 、
NOTIFICATION、
FILE、 //文件消息
NETCALL_AUDIO、 //网络电话音频聊天
NETCALL_VEDIO、 //网络电话视频聊天
DATATUNNEL_NEW、 //新的数据通道请求通知
TIPS、 //提示类型消息
CUSTOM //自定义消息

会话具体类型CUSTOM_PERSON对应的通知消息类型:
FRIEND_ADD、 //加好友
FRIEND_DELETE、 //删除好友
CUSTOM_P2P_MSG、 //个人自定义系统通知

会话具体类型CUSTOM_TEAM对应的通知消息类型:
TEAM_APPLY、 //申请入群
TEAM_APPLY_REJECT、 //拒绝入群申请
TEAM_INVITE、 //邀请进群
TEAM_INVITE_REJECT、 //拒绝邀请
TLIST_UPDATE、 //群信息更新
CUSTOM_TEAM_MSG、 //群组自定义系统通知
body String消息内容,字符串类型
attach String附加消息,字符串类型
msgidClient String客户端生成的消息id,仅在convType为PERSON或TEAM含此字段,字符串类型
msgidServer String服务端生成的消息id,可转为Long型数据
resendFlag String重发标记:0不是重发, 1是重发。仅在convType为PERSON或TEAM时含此字段,可转为Integer类型数据
customSafeFlag String自定义系统通知消息是否存离线:0:不存,1:存。
仅在convType为CUSTOM_PERSON或CUSTOM_TEAM时含此字段,可转为Integer类型数据
customApnsText String自定义系统通知消息推送文本。仅在convType为CUSTOM_PERSON或CUSTOM_TEAM时含此字段,字符串类型
tMembers String 跟本次群操作有关的用户accid,仅在convType为TEAM或CUSTOM_TEAM时含此字段,字符串类型。
tMembers格式举例:
{
... // 其他字段
"tMembers":"[123, 456]" //相关的accid为 123 和 456
}
ext String消息扩展字段
antispam String标识是否被反垃圾,仅在被反垃圾时才有此字段,可转为Boolean类型数据
yidunRes String易盾反垃圾的原始处理细节,只有接入了相关功能易盾反垃圾的应用才会有这个字段。详见以下1.4.5.1、P2P:文本消息 和 1.4.5.2、P2P:图片消息的举例说明。

该字段中子字段释义如下:
yidunBusType:0:易盾文本反垃圾业务;1、易盾图片反垃圾业务;2、用户资料反垃圾业务;3、用户头像反垃圾业务。

action:处理结果:检测结果,0:通过,1:嫌疑,2:不通过。 (只有yidunBusType为0或2时,抄送时才有此字段)

labels:具体的反垃圾判断细节:
文本类反垃圾参考:
http://support.dun.163.com/documents/2018041901?docId=150425947576913920 labels字段的释义
图片类反垃圾参考:
http://support.dun.163.com/documents/2018041902?docId=150429557194936320 labels字段的释义

1.4 消息抄送详细示例

1.4.1. 相关字段释义

1.4.2. 讨论组操作

1.4.3. 高级群操作

1.4.4. 好友操作

1.4.5. P2P消息

1.4.6. 群组消息

讨论组和高级群相关消息抄送中部分字段的格式定义如下:
———————————————————————————————————————————————————————————————
attach字段中tinfo字段的定义,为JSONObject:
    //群信息
    "tinfo": {
        "1":"群组id,可转为Long型",
        "3":"群名称",
        "4":"群类型,0表示讨论组,1表示高级群",
        "5":"创建者用户帐号",
        "7":"群公告等各种属性",
        "8":"群有效标记,0表示无效,1表示有效",
        "9":"群有效成员个数",
        "10":"群组成员列表更新的时间戳,精确到毫秒",
        "11":"创建时间,精确到毫秒",
        "12":"更新时间,精确到毫秒",
        "14":"群介绍",
        "15":"群公告,为JSONArray的toString,格式参考下文",
        "16":"群属性,0表示入群不需要申请,1表示入群需要申请",
        "18":"第三方扩展字段",
        "19":"第三方服务器扩展字段",
        "20":"群头像",
        "21":"被邀请人同意方式", 0:需要统一(默认),1:不需要同意,
        "22":"谁可以邀请他人入群", 0:管理员(默认),1:所有人,
        "23":"谁可以修改群资料", 0:管理员(默认),1:所有人,
        "24":"谁可以更新群自定义属性"0:管理员(默认),1:所有人
    }

tinfo中"15"群公告字段的格式如下:
    "tinfo": {
        "15": "
         [
            {
                "title":"这是群公告标题",
                "content":"这是群公告内容",
                "creator":"群公告发表者",
                "time":1457075964         //群公告发表时间,10位时间戳,精确到秒
            },
            {}
         ]
        ",
        //其他的字段
    }
———————————————————————————————————————————————————————————————
attach字段中uinfos字段的定义,为JSONArray:
    //用户信息
    "uinfos": [
        {
            "1":"用户帐号",
            "3":"用户昵称",
            "4":"用户头像地址",
            "5":"个性签名",
            "6":"性别",
            "7":"邮箱",
            "8":"生日",
            "9":"手机号",
            "10":"扩展字段",
            "12":"创建时间",
            "13":"更新时间"
        },
        {}
    ]
———————————————————————————————————————————————————————————————
attach字段中id字段的释义:
0:TEAM_INVITE,即群拉人
1:TEAM_KICK,即群踢人
2:TEAM_LEAVE,即退出群
3:TEAM_UPDATE,即更新群信息
4:TEAM_DISMISS,即群解散
5:TEAM_APPLY_PASS,即群申请加入成功
6:TEAM_OWNER_TRANSFER,即群主退群并移交群主
7:TEAM_ADD_MANAGER,即增加管理员
8:TEAM_REMOVE_MANAGER,即删除管理员
9:TEAM_INVITE_ACCEPT,即群接受邀请进群
———————————————————————————————————————————————————————————————
注意:没有给出定义的字段都是第三方无需关心的字段,可忽略

1.4.2.1、创建讨论组:

抄送示例:
{"attach":"{\"data\":{\"ids\":[\"wangwu\",\"zhaoliu\",\"lisi\"],\"tinfo\":{\"1\":\"11927\",\"10\":\"1458886362629\",\"11\":\"1458886362629\",\"12\":\"1458886362629\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"讨论组\",\"4\":\"0\",\"5\":\"zhangsan\",\"6\":\"10000\",\"8\":\"1\",\"9\":\"4\"},\"uinfos\":[{\"1\":\"wangwu\",\"11\":\"236911\",\"12\":\"1457417052774\",\"13\":\"1457491548992\",\"2\":\"11011\",\"3\":\"wangwu\",\"6\":\"0\"},{\"1\":\"zhaoliu\",\"11\":\"237017\",\"12\":\"1457492303776\",\"13\":\"1457492303776\",\"2\":\"11011\",\"3\":\"zhaoliu\",\"6\":\"0\"},{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"},{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1456885865056\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"1\"}]},\"id\":0}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1458886362746","msgType":"NOTIFICATION","msgidClient":"731f5145-0f98-4ae2-aaa4-ee0f210507d2","msgidServer":"800407420929","resendFlag":"0","tMembers":"[zhangsan]","to":"11927"}

attach字段释义
{
  "data": {
    //ids表示创建讨论组时被拉入讨论组的用户账号
    "ids":[
        "wangwu","zhaoliu","lisi"
    ],
    //群信息,具体参考tinfo字段的定义
    "tinfo": {

    },
    //创建讨论组时被拉入讨论组的用户,以及讨论组创建者的用户帐号信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 0    //讨论组拉人,创建讨论组时需拉人
}

tMembers字段释义:
{
    "tMembers":"[zhangsan]" //讨论组创建者
}

1.4.2.2、修改讨论组信息:

抄送示例:
{"attach":"{\"data\":{\"tinfo\":{\"1\":\"11927\",\"3\":\"修改后的讨论组名称\"},\"uinfos\":[{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1456885865056\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"1\"}]},\"id\":3}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1458886916106","msgType":"NOTIFICATION","msgidClient":"dd741c41-0a3a-4ef4-900b-ffbceffe3d22","msgidServer":"800407420931","resendFlag":"0","tMembers":"[zhaoliu, wangwu, zhangsan, lisi]","to":"11927"}

attach字段释义
{
  "data": {
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //创建讨论组时被拉入讨论组的用户,以及讨论组创建者的用户帐号信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 3    //修改讨论组信息
}

tMembers字段释义:
{
    "tMembers":"[zhaoliu, wangwu, zhangsan, lisi]" //讨论组内成员
}

1.4.2.3、讨论组拉人:

抄送示例:
{"attach":"{\"data\":{\"ids\":[\"lisi\"],\"tinfo\":{\"1\":\"11927\",\"10\":\"1458887669091\",\"11\":\"1458886362629\",\"12\":\"1458887669121\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"修改后的讨论组名称\",\"4\":\"0\",\"5\":\"zhangsan\",\"6\":\"10000\",\"8\":\"1\",\"9\":\"3\"},\"uinfos\":[{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"},{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1456885865056\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"1\"}]},\"id\":0}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1458887669137","msgType":"NOTIFICATION","msgidClient":"e5fe2160-de34-4e1c-a87b-7f298aa7b7b2","msgidServer":"800407420940","resendFlag":"0","tMembers":"[zhaoliu, zhangsan]","to":"11927"}

attach字段释义
{
  "data": {
      //ids表示被加入的用户帐号
      "ids":[
          "lisi"
      ],
      //群组信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //被加入的用户,以及操作人的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 0    //群拉人
}

tMembers字段释义:
{
    "tMembers":"[zhaoliu, zhangsan]" //讨论组内原有成员,不包含被拉人的用户
}

1.4.2.4、讨论组踢人:

抄送示例:
{"attach":"{\"data\":{\"ids\":[\"wangwu\"],\"tinfo\":{\"1\":\"11927\",\"10\":\"1458887253106\",\"11\":\"1458886362629\",\"12\":\"1458887253159\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"修改后的讨论组名称\",\"4\":\"0\",\"5\":\"zhangsan\",\"6\":\"10000\",\"8\":\"1\",\"9\":\"3\"},\"uinfos\":[{\"1\":\"wangwu\",\"11\":\"236911\",\"12\":\"1457417052774\",\"13\":\"1457491548992\",\"2\":\"11011\",\"3\":\"wangwu\",\"6\":\"0\"},{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1456885865056\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"1\"}]},\"id\":1}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1458887253168","msgType":"NOTIFICATION","msgidClient":"693b8b53-3d0e-445e-b086-debaffa7a376","msgidServer":"800407420932","resendFlag":"0","tMembers":"[zhaoliu, wangwu, zhangsan, lisi]","to":"11927"}

attach字段释义
{
  "data": {
      //ids表示被踢出讨论组的用户帐号
      "ids":[
          "wangwu"
      ],
      //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //被踢的用户,以及操作人的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 1    //讨论组踢人
}

tMembers字段释义:
{
    "tMembers":"[zhaoliu, wangwu, zhangsan, lisi]" //讨论组内成员,包含被踢出的用户
}

1.4.2.5、退出讨论组:

抄送示例:
{"attach":"{\"data\":{\"tinfo\":{\"1\":\"11927\",\"10\":\"1458887477194\",\"11\":\"1458886362629\",\"12\":\"1458887477199\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"修改后的讨论组名称\",\"4\":\"0\",\"5\":\"zhangsan\",\"6\":\"10000\",\"8\":\"1\",\"9\":\"2\"},\"uinfos\":[{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1456885865056\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"1\"}]},\"id\":2}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"","fromNick":"zhangsan","msgTimestamp":"1458887477210","msgType":"NOTIFICATION","msgidClient":"4bcad22a-12de-4691-9ba7-fa112aa46ea7","msgidServer":"800407420936","resendFlag":"0","tMembers":"[wangwu, zhaoliu, zhangsan, lisi]","to":"11927"}

attach字段释义
{
  "data": {
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //退出讨论组的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {}
    ]
  },
  "id": 2    //退出讨论组
}

tMembers字段释义:
{
    "tMembers":"[zhaoliu, wangwu, zhangsan, lisi]" //讨论组内成员,包含退出的用户
}

1.4.3.1、创建高级群:

抄送示例:
{"attach":"{\"tinfo\":{\"1\":\"11620\",\"10\":\"1456802852027\",\"11\":\"1456802852027\",\"12\":\"1456802852027\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"1\"}}","body":"邀请你加入群组","convType":"CUSTOM_TEAM","customSafeFlag":"0","eventType":"1","fromAccount":"zhangsan","msgTimestamp":"1456802852094","msgType":"TEAM_INVITE","msgidServer":"371929","tMembers":"[lisi]","to":"11620"}

attach字段释义
{
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    }
}

1.4.3.2、解散高级群

抄送示例:
{"attach":"{\"data\":{\"uinfos\":[{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"}]},\"id\":4}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromNick":"zhangsan","msgTimestamp":"1456810468999","msgType":"NOTIFICATION","msgidClient":"b697a6b2-be71-47f0-8fc0-3c7ff9b15dda","msgidServer":"779872108546","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11621"}

attach字段释义
{
  "data": {
    //解散群的操作人的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 4    //解散群
}

tMembers字段释义:
{
    "tMembers":"[lisi]" //解散高级群时的群内所有成员列表,包含群主
}

1.4.3.3、高级群邀请他人加群

抄送示例:
{"attach":"{\"tinfo\":{\"1\":\"11623\",\"10\":\"1456817802112\",\"11\":\"1456811497999\",\"12\":\"1456817802112\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"1\"}}","body":"邀请你加入群组","convType":"CUSTOM_TEAM","customSafeFlag":"0","eventType":"1","fromAccount":"zhangsan","msgTimestamp":"1456818444874","msgType":"TEAM_INVITE","msgidServer":"373171","tMembers":"[lisi]","to":"11623"}

attach字段释义:
{
  "data": {
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    }
  }
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //被邀请入群的用户列表
}

1.4.3.4、高级群接受邀请入群

抄送示例:
{"attach":"{\"data\":{\"id\":\"zhangsan\",\"tinfo\":{\"1\":\"11623\",\"10\":\"1456811521765\",\"11\":\"1456811497999\",\"12\":\"1456811521899\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"2\"},\"uinfos\":[{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"},{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"}]},\"id\":9}","convType":"TEAM","eventType":"1","fromAccount":"lisi","fromClientType":"IOS","msgTimestamp":"1456811521946","msgType":"NOTIFICATION","msgidClient":"335cf3bb-8efa-4cde-953d-9aa775f1a2b2","msgidServer":"780006326273","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11623"}

attach字段释义:
{
  "data": {
    //邀请人
    "id":"邀请人的帐号",
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //邀请人与被邀请人的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 9    //高级群接受邀请邀请入群
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括邀请人和被邀请人
}

1.4.3.5、高级群拒绝邀请入群

抄送示例:
{"body":"","convType":"CUSTOM_TEAM","customSafeFlag":"0","eventType":"1","fromAccount":"lisi","msgTimestamp":"1456819928681","msgType":"TEAM_INVITE_REJECT","msgidServer":"373998","to":"11623"}

1.4.3.6、高级群增加管理员

抄送示例:
{"attach":"{\"data\":{\"ids\":[\"lisi\"],\"uinfos\":[{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"},{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"}]},\"id\":7}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1456813138663","msgType":"NOTIFICATION","msgidClient":"3e3e2efe-4f16-4ac2-8669-a8ee17be80bc","msgidServer":"780006326274","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11623"}

attach字段释义:
{
  "data": {
    //邀请人
    "ids":[
        "被设为管理员的用户帐号1",
        "被设为管理员的用户帐号2"
    ],
    //操作人与被操作人的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 7    //高级群增加管理员
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括操作人和被操作人
}

1.4.3.7、高级群删除管理员

抄送示例:
{"attach":"{\"data\":{\"ids\":[\"lisi\"],\"uinfos\":[{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"},{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"}]},\"id\":8}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1456815660948","msgType":"NOTIFICATION","msgidClient":"a2b8f49a-cc06-4784-a8e4-84b59c9ac85f","msgidServer":"780006326275","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11623"}

attach字段释义:
{
  "data": {
    //邀请人
    "ids":[
        "被删除管理员的用户帐号1",
        "被删除管理员的用户帐号2"
    ],
    //操作人与被操作人的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 8    //高级群删除管理员
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括操作人和被操作人
}

1.4.3.8、高级群踢人出群

抄送示例:
{"attach":"{\"data\":{\"ids\":[\"lisi\"],\"tinfo\":{\"1\":\"11623\",\"10\":\"1456816081224\",\"11\":\"1456811497999\",\"12\":\"1456816081359\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"1\"},\"uinfos\":[{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"},{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"}]},\"id\":1}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1456816081368","msgType":"NOTIFICATION","msgidClient":"f3c0437d-fd3c-4900-9b80-ef9c86c1f91f","msgidServer":"780006326276","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11623"}

attach字段释义:
{
  "data": {
    //邀请人
    "ids":[
        "被踢出群的用户帐号1",
        "被踢出群的用户帐号2"
    ],
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //操作人与被操作人的用户信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 1    //高级群踢人出群
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括操作人和被操作人
}

1.4.3.9、高级群申请加入成功(无需加群验证)

抄送示例:
{"attach":"{\"data\":{\"id\":\"lisi\",\"tinfo\":{\"1\":\"11631\",\"10\":\"1457075685304\",\"11\":\"1456823028193\",\"12\":\"1457075963090\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"2\"},\"uinfos\":[{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"},{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"}]},\"id\":5}","convType":"TEAM","eventType":"1","fromAccount":"lisi","fromClientType":"IOS","msgTimestamp":"1457076245920","msgType":"NOTIFICATION","msgidClient":"39a89280-edda-47ff-8f2a-3a2a9ae03cf4","msgidServer":"780543197222","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11631"}

attach字段释义:
{
  "data": {
    //邀请人
    "id":"申请加入成功的用户帐号",
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //操作人与被操作人的用户信息,
    //此处操作人与被操作人是同一个人,uinfos包含两条同样的信息
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 5    //高级群申请加入成功
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括加入成功的用户
}

1.4.3.10、申请加入高级群(需要验证)

抄送示例:
{"body":"wangwu申请加群","convType":"CUSTOM_TEAM","customSafeFlag":"0","eventType":"1","fromAccount":"lisi","msgTimestamp":"1456821259709","msgType":"TEAM_APPLY","msgidServer":"375024","tMembers":"[zhangsan, li]","to":"11623"}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群主和管理员帐号
}

1.4.3.11、允许加群申请

抄送示例:
{"attach":"{\"data\":{\"id\":\"lisi\",\"tinfo\":{\"1\":\"11623\",\"10\":\"1456821386734\",\"11\":\"1456811497999\",\"12\":\"1456821386758\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"1\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"2\"},\"uinfos\":[{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"},{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"}]},\"id\":5}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1456821386769","msgType":"NOTIFICATION","msgidClient":"dd36c8a2-30e7-476a-9608-48879f4d3146","msgidServer":"780006326282","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11623"}

attach字段释义:
{
  "data": {
    //邀请人
    "id":"申请加群的用户帐号",
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //操作人与被操作人的用户信息,
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 5    //高级群申请加入成功
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括加入成功的用户
}

1.4.3.12、拒绝加群申请

抄送示例:
{"attach":"{\"tinfo\":{\"1\":\"11623\",\"10\":\"1456821961295\",\"11\":\"1456811497999\",\"12\":\"1456821961295\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"1\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"1\"}}","body":"","convType":"CUSTOM_TEAM","customSafeFlag":"0","eventType":"1","fromAccount":"zhangsan","msgTimestamp":"1456822044104","msgType":"TEAM_APPLY_REJECT","msgidServer":"375093","to":"11623"}

attach字段释义:
{
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    }
}

1.4.3.13、退出高级群

抄送示例:
{"attach":"{\"data\":{\"tinfo\":{\"1\":\"11623\",\"10\":\"1456817802112\",\"11\":\"1456811497999\",\"12\":\"1456817802112\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"zhangsan\",\"6\":\"10\",\"8\":\"1\",\"9\":\"1\"},\"uinfos\":[{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"}]},\"id\":2}","convType":"TEAM","eventType":"1","fromAccount":"lisi","fromClientType":"IOS","fromNick":"lisi","msgTimestamp":"1456817802118","msgType":"NOTIFICATION","msgidClient":"9ea8ad94-7b8e-4793-8302-23b554b3d5ca","msgidServer":"780006326278","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11623"}

attach字段释义:
{
  "data": {
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //退出群的用户信息,
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 2    //退出高级群
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括退出群的用户
}

1.4.3.14、更新高级群

抄送示例:
{"attach":"{\"data\":{\"tinfo\":{\"1\":\"11623\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"1\"},\"uinfos\":[{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"}]},\"id\":3}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","msgTimestamp":"1456822570528","msgType":"NOTIFICATION","msgidClient":"473b64e3-5b76-4fd8-ba74-b29a8ec71f7d","msgidServer":"780006326286","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11623"}


attach字段释义:
{
  "data": {
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //更新群信息的操作人信息,
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 3    //更新群信息
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括更新群的用户
}

1.4.3.15、移交群主

抄送示例:
{"attach":"{\"data\":{\"id\":\"lisi\",\"tinfo\":{\"1\":\"11631\",\"10\":\"1456823264040\",\"11\":\"1456823028193\",\"12\":\"1456823264170\",\"14\":\"这是群介绍\",\"15\":\"[{\\\"title\\\":\\\"这是群公告标题\\\",\\\"content\\\":\\\"这是群公告内容\\\",\\\"creator\\\":\\\"zhangsan\\\",\\\"time\\\":1457075964}]\",\"16\":\"0\",\"17\":\"0\",\"2\":\"11011\",\"21\":\"0\",\"22\":\"0\",\"23\":\"0\",\"24\":\"0\",\"3\":\"高级群\",\"4\":\"1\",\"5\":\"lisi\",\"6\":\"10\",\"8\":\"1\",\"9\":\"2\"},\"uinfos\":[{\"1\":\"zhangsan\",\"11\":\"142915\",\"12\":\"1438738423546\",\"13\":\"1446624332920\",\"2\":\"11011\",\"3\":\"zhangsan\",\"4\":\"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=\",\"6\":\"0\"},{\"1\":\"lisi\",\"11\":\"142916\",\"12\":\"1438740370586\",\"13\":\"1438740370586\",\"2\":\"11011\",\"3\":\"lisi\",\"6\":\"0\"}]},\"id\":6}","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"REST","msgTimestamp":"1456823264181","msgType":"NOTIFICATION","msgidClient":"92606e37-e22f-4cd1-a13c-fc6ec7353a1b","msgidServer":"780543197186","resendFlag":"0","tMembers":"[zhangsan, lisi]","to":"11631"}

attach字段释义:
{
  "data": {
    "id":"新群主的用户帐号"
    //群信息
    //具体参考tinfo字段的定义
    "tinfo": {

    },
    //新群主和老群主的信息,
    //具体参考uinfos字段的定义
    "uinfos": [
        {},
        {}
    ]
  },
  "id": 6    //更新群信息
}

tMembers字段释义:
{
    "tMembers":"[zhangsan, lisi]" //群内有效用户帐号列表,包括新群主和老群主
}
1.4.4.1、加好友
抄送示例:
{"attach":"{\"vt\":1}","body":"","convType":"CUSTOM_PERSON","customSafeFlag":"0","eventType":"1","fromAccount":"zhangsan","msgTimestamp":"1456827801260","msgType":"FRIEND_ADD","msgidServer":"375387","to":"lisi"}

attach字段释义:
{
  "vt": 1   //vt即verify type,加好友验证类型。1:直接加好友,无需验证;2:请求加好友,需要验证;3:同意加好友申请;4:拒绝加好友申请
}

1.4.4.2、删除好友

抄送示例:
{"convType":"CUSTOM_PERSON","customSafeFlag":"0","eventType":"1","fromAccount":"zhangsan","msgTimestamp":"1456827724200","msgType":"FRIEND_DELETE","msgidServer":"375386","to":"lisi"}

1.4.5.1、P2P:文本消息

抄送示例:
{"attach":"","body":"文字消息","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456888017105","msgType":"TEXT","msgidClient":"f33f0716-6027-47de-a582-37a8dc2d217c","msgidServer":"8364607","resendFlag":"0","to":"lisi","yidunRes":"{\"yidunBusType\":0,\"action\":0,\"labels\":[]}"}

1.4.5.2、P2P:图片消息

抄送示例:
{"attach":"{\"md5\":\"d0323f8d447abf3df7256bd66f9d5b62\",\"h\":500,\"ext\":\"jpg\",\"size\":9093,\"w\":500,\"name\":\"图片发送于2016-03-02 11:09\",\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyOF8wOWE1ZmVlMS1lOGQ4LTQwMzItOGZkMS0yMWE1ODBjYjA1MWE=\"}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456888195062","msgType":"PICTURE","msgidClient":"472f2f50-2b00-4d7b-8b8d-d8870daa0dbd","msgidServer":"8364613","resendFlag":"0","to":"lisi","yidunRes":"{\"yidunBusType\":1,\"labels\":[{\"level\":0,\"rate\":0.0,\"label\":100},{\"level\":0,\"rate\":0.0,\"label\":200},{\"level\":0,\"rate\":0.0,\"label\":110},{\"level\":0,\"rate\":0.0,\"label\":400},{\"level\":0,\"rate\":0.0,\"label\":300},{\"level\":0,\"rate\":0.0,\"label\":210}]}"}

attach字段释义:
{
  "md5":"xxxxxxxx",      //图片的md5值
  "h":500,               //图片的高
  "w":500,               //图片的宽
  "size":9093,           //图片的大小
  "name":"xxxxxxxx",     //图片的名称
  "url":"xxxxxxxx",      //图片的url
  "ext":"jpg"            //图片格式
}

1.4.5.3、P2P:音频消息

抄送示例:
{"attach":"{\"size\":14181,\"ext\":\"aac\",\"dur\":3900,\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyN18xYjRlOTc4My0zYzFkLTQ5NzUtOTY2NC1hOTkzMzAzOGZiZjc=\",\"md5\":\"4c5cc81dd00817b548b5eef42eac4d11\"}","body":"发来了一段语音","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456888940830","msgType":"AUDIO","msgidClient":"b0b703ea-3e10-453e-8650-e3a2802130bd","msgidServer":"8364635","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "size":14181,          //音频的大小
  "ext":"aac",           //音频的格式
  "dur":3900,            //音频的时长
  "url":"xxxxxxxx",      //音频的url
  "md5":"xxxxxxxx"       //音频的md5值
}

1.4.5.4、P2P:视频消息

抄送示例:
{"attach":"{\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyN18xZGNkMjQzNi02OTg2LTQxNGEtYWE5ZC04ZDhmYjQyMTE2OTQ=\",\"md5\":\"c2f2e15af1c9e341187f81e5f8453399\",\"ext\":\"mp4\",\"h\":480,\"size\":114347,\"w\":360,\"name\":\"视频发送于2016-03-02 11:16\",\"dur\":1456}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456888595916","msgType":"VIDEO","msgidClient":"57a33622-cd80-4c65-b8d3-15f3c2bb128f","msgidServer":"8364616","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "url":"xxxxxxxx",      //视频的url
  "md5":"xxxxxxxx",      //视频的md5值
  "ext":"mp4",           //视频的格式
  "h":"480",             //视频的高
  "w":"360",             //视频的宽
  "size":14181,          //视频的大小
  "name":"xxxxxxxx",     //视频的名称
  "dur":1456             //视频的时长
}

1.4.5.5、P2P:地理位置信息

抄送示例:
{"attach":"{\"lat\":30.18704515647036,\"lng\":120.1908686708565,\"title\":\"中国 浙江省 杭州市 网商路 599号\"}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"REST","fromDeviceId":"","fromNick":"zhangsan","msgTimestamp":"1456897243862","msgType":"LOCATION","msgidClient":"6f9804ac-d584-422e-85a2-5f0167df65cf","msgidServer":"8364682","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "lat":30.18704515647036,   //纬度
  "lng":120.1908686708565,   //经度
  "title":"xxxxxxxx"         //地理位置的title
}

1.4.5.6、P2P:文件消息

抄送示例:
{"attach":"{\"ext\":\"ttf\",\"md5\":\"79d62a35fa3d34c367b20c66afc2a500\",\"name\":\"BlizzardReg.ttf\",\"size\":\"91680\",\"url\":\"http:\\/\\/nimtest.nos.netease.com\\/08c9859d-183f-4daa-9904-d6cacb51c95b\"}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"E8977274-3CD1-494D-95C4-EA633G63B5B5","fromNick":"zhangsan","msgTimestamp":"1456897960993","msgType":"FILE","msgidClient":"e1177d7c-c693-4a91-b0ef-f47f48793d9e","msgidServer":"8364686","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "ext":"xxxxxxxx",          //文件的类型
  "md5":"xxxxxxxx",          //文件的md5值
  "name":"xxxxxxxx",         //文件名
  "size":"xxxxxxxx",         //文件的大小
  "url":"xxxxxxxx"           //文件的URL
}

1.4.5.7、P2P:自定义消息(msgType类型为CUSTOM)

抄送示例:
{"attach":"{"myKey1":\"myValue1\",\"myKey2\":2}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"REST","fromDeviceId":"","fromNick":"zhangsan","msgTimestamp":"1456898248757","msgType":"CUSTOM","msgidClient":"1f929f45-1b5e-495e-b76c-465a4187be52","msgidServer":"8364702","resendFlag":"0","to":"lisi"}

attach字段释义:由第三方自己定义并解析相应的Key-Value值


SDK中定义的几类自定义消息释义: 
————————————————
剪刀石头布(type = 1):
{"attach":"{\"type\":1,\"data\":{\"value\":1}}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456904008340","msgType":"CUSTOM","msgidClient":"39efd6b1-a6f4-41cd-88f8-357cdf385d3e","msgidServer":"8365170","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "type":1                                    //type=1表示是剪刀石头布
  "data": {
    "value":1                                 //1:石头;2:剪刀;3:布
  }
}
————————————————
阅后即焚(type = 2):
{"attach":"{\"type\":2,\"data\":{\"md5\":\"8C40A5F0F56A8FA2CAC5D2A487D3D429\",\"fired\":false,\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyNl9iOTI4MmVhMC02ZTM2LTQ3YjYtOTVhNC01MWRmNmI3NjZjMzg=\"}}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456904040460","msgType":"CUSTOM","msgidClient":"f11be78c-31d9-48f3-92f8-35a3806c3511","msgidServer":"8365185","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "type":2                                    //type=2表示是阅后即焚
  "data": {
    "md5":8C40A5F0F56A8FA2CAC5D2A487D3D429,   //阅后即焚的图片的md5值
    "url":"图片地址",                          //阅后即焚的图片地址
    "fired":false                             //标记在查看前是否焚毁,一般都为false,可以不理会
  }
}
————————————————
贴图表情(type = 3):
{"attach":"{\"type\":3,\"data\":{\"catalog\":\"xxy\",\"chartlet\":\"xxy002\"}}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1458815489454","msgType":"CUSTOM","msgidClient":"e9ff8a99-1fc2-4646-8907-3312f4538c09","msgidServer":"8414888","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "type":3                                    //type=3表示是贴图表情
  "data": {
    "catalog":"xxy",                          //贴图所在文件夹的名称
    "chartlet":"xxy002"                       //贴图文件的名称
  }
}
————————————————
白板会话(type = 4)::
{"attach":"{\"type\":4,\"data\":{\"flag\":0}}","body":"","convType":"PERSON","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456904076370","msgType":"CUSTOM","msgidClient":"5545d9c6-7700-45bd-9fff-7e18294f159b","msgidServer":"8365186","resendFlag":"0","to":"lisi"}

attach字段释义:
{
  "type":4                            //type=4表示是白板会话
  "data": {
    "flag":0                          //0:邀请白板会话;1:关闭白板会话
  }
}

1.4.5.8、P2P:自定义系统通知

抄送示例:
{"attach":"{\"myKey1\":\"myValue1\",\"myKey2\":10}","body":"","convType":"CUSTOM_PERSON","customApnsText":"","customSafeFlag":"0","eventType":"1","fromAccount":"zhangsan","msgTimestamp":"1456913798613","msgType":"CUSTOM_P2P_MSG","msgidServer":"381209","to":"lisi"}

1.4.6.1、群组:文本消息

抄送示例:
{"attach":"","body":"文本消息","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456914408870","msgType":"TEXT","msgidClient":"f4c98f2c-b2bf-4d22-8cca-cb5c32e7aa3a","msgidServer":"780543197190","resendFlag":"0","tMembers":"[lisi]","to":"11631"}

tMembers字段说明:tMembers字段为群内除发送者外所有的有效群成员帐号的JSONArray串,以下群消息中的tMembers字段为相同概念,下略。

1.4.6.2、群组:图片消息

抄送示例:
{"attach":"{\"md5\":\"d0323f8d447abf3df7256bd66f9d5b62\",\"h\":500,\"ext\":\"jpg\",\"size\":9093,\"w\":500,\"name\":\"图片发送于2016-03-02 18:29\",\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyNl84NzBmZjY5Ni0yOGI5LTRiZDgtYjQ4Yy02ZmVjYWI0NjcxM2Y=\"}","body":"","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456914540323","msgType":"PICTURE","msgidClient":"b3b1f911-d174-4417-9ffc-8f0e2b8becf5","msgidServer":"779603673092","resendFlag":"0","tMembers":"[lisi]","to":"11617"}

attach字段释义:参考P2P消息中的图片消息中attach字段释义

1.4.6.3、群组:音频消息

抄送示例:
{"attach":"{\"size\":13738,\"ext\":\"aac\",\"dur\":3808,\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyNl9lOWExMmNmMy1lZDhkLTQ2Y2UtYWRiYS1mOTA4ODhjZTliNTM=\",\"md5\":\"35411b36f22077309daec3b970b46e89\"}","body":"发来了一段语音","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456914620057","msgType":"AUDIO","msgidClient":"652d7015-9ee8-4e25-b1e7-40a3b534f4a5","msgidServer":"779603673093","resendFlag":"0","tMembers":"[lisi]","to":"11617"}

attach字段释义:参考P2P消息中的音频消息中attach字段释义

1.4.6.4、群组:视频消息

抄送示例:
{"attach":"{\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyNl9hMmJhOTIzMS1mM2NkLTQ0MTctOWI0OC1kZWRhOTFjNGUzZjA=\",\"md5\":\"6ba2b50225469d46263ba70736c37cd3\",\"ext\":\"mp4\",\"h\":480,\"size\":150495,\"w\":360,\"name\":\"视频发送于2016-03-02 18:31\",\"dur\":1473}","body":"","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456914687808","msgType":"VIDEO","msgidClient":"d4ce8255-b9f8-4682-8ba2-a60f31be454a","msgidServer":"779603673094","resendFlag":"0","tMembers":"[lisi]","to":"11617"}

attach字段释义:参考P2P消息中的视频消息中attach字段释义

1.4.6.5、群组:地理位置消息

抄送示例:
{"attach":"{\"lat\":30.18704515647036,\"lng\":120.1908686708565,\"title\":\"中国 浙江省 杭州市 网商路 599号\"}","body":"","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"REST","fromDeviceId":"","fromNick":"zhangsan","msgTimestamp":"1456914808531","msgType":"LOCATION","msgidClient":"1bc0a22a-e255-4ac7-8638-6ba3e9648550","msgidServer":"780543197191","resendFlag":"0","tMembers":"[lisi]","to":"11631"}

attach字段释义:参考P2P消息中的地理位置消息中attach字段释义

1.4.6.6、群组:文件消息

抄送示例:
{"attach":"{\"ext\":\"ttf\",\"md5\":\"79d62a35fa3d34c367b20c66afc2a500\",\"name\":\"BlizzardReg.ttf\",\"size\":\"91680\",\"url\":\"http:\\/\\/nimtest.nos.netease.com\\/08c9859d-183f-4daa-9904-d6cacb51c95b\"}","body":"","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"REST","fromDeviceId":"","fromNick":"zhangsan","msgTimestamp":"1456969602600","msgType":"FILE","msgidClient":"5abd008f-4d94-41a4-89f4-bc6aa3c5dc1f","msgidServer":"780543197192","resendFlag":"0","tMembers":"[lisi]","to":"11631"}

attach字段释义:参考P2P消息中的发送文件消息中attach字段释义

1.4.6.7、群组:自定义消息

抄送示例:
{"attach":"{\"myKey1\":\"myValue1\",\"myKey2\":10}","body":"","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"REST","fromDeviceId":"","fromNick":"zhangsan","msgTimestamp":"1456969938208","msgType":"CUSTOM","msgidClient":"4e330c5e-7f71-4f69-a51b-e6c884760866","msgidServer":"780543197194","resendFlag":"0","tMembers":"[lisi]","to":"11631"}

attach字段释义:由第三方自己定义并解析相应的Key-Value值


SDK中定义的几类自定义消息释义:
————————————————
剪刀石头布(type = 1):
{"attach":"{\"type\":1,\"data\":{\"value\":3}}","body":"","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456970142720","msgType":"CUSTOM","msgidClient":"f051c3ab-89a4-4278-b311-02d679f97898","msgidServer":"780543197195","resendFlag":"0","tMembers":"[lisi]","to":"11631"}

attach字段释义:
{
  "type":1                                    //type=1表示是剪刀石头布
  "data": {
    "value":3                                 //1:石头;2:剪刀;3:布
  }
}

————————————————
贴图表情(type = 3):
{"attach":"{\"type\":3,\"data\":{\"catalog\":\"xxy\",\"chartlet\":\"xxy001\"}}","body":"","convType":"TEAM","eventType":"1","fromAccount":"zhangsan","fromClientType":"IOS","fromDeviceId":"B0BFF2EB-E2E1-4063-9E73-92FB926BF388","fromNick":"zhangsan","msgTimestamp":"1456971231090","msgType":"CUSTOM","msgidClient":"a0989c85-f85a-43a6-8ba5-d2509cf30d4b","msgidServer":"780543197215","resendFlag":"0","tMembers":"[lisi]","to":"11631"}

attach字段释义:
{
  "type":3                                    //type=3表示是贴图表情
  "data": {
    "catalog":"xxy",                          //贴图所在文件夹的名称
    "chartlet":"xxy002"                       //贴图文件的名称
  }
}

1.4.5.8、群组:自定义系统通知

抄送示例:
{"attach":"{\"myKey1\":\"myValue1\",\"myKey2\":10}","body":"","convType":"CUSTOM_TEAM","customApnsText":"","customSafeFlag":"0","eventType":"1","fromAccount":"zhangsan","msgTimestamp":"1456972250344","msgType":"CUSTOM_TEAM_MSG","msgidServer":"382250","tMembers":"[lisi]","to":"11631"}

登录事件消息抄送

2. "eventType"="2"。需要单独开通,如有需要,请联系相关网易云通信商务经理。

2.1 HTTP示例:

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"accid":"test","clientIp":"192.168.1.100","clientType":"PC","code":"200","eventType":"2","sdkVersion":"18","timestamp":"1452504942126"}

2.2 cURL示例:

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"accid":"test","clientIp":"192.168.1.100","clientType":"PC","code":"200","eventType":"2","sdkVersion":"18","timestamp":"1452504942126"}' 'http://yunxinservice.com.cn/receiveMsg.action'

2.3 消息体中的JSON字段说明:

名称类型说明
eventType String值为2,表示是登录事件的消息
accid String发生登录事件的用户帐号,字符串类型
clientIp String登录时的ip地址
clientType String客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST,字符串类型
code String登录事件的返回码,可转为Integer类型数据
sdkVersion String当前sdk的版本信息,字符串类型
timestamp String登录事件发生时的时间戳,可转为Long型数据

登出事件消息抄送

3. "eventType"="3"。需要单独开通,如有需要,请联系相关网易云通信商务经理。

3.1 HTTP示例:

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"accid":"test","clientIp":"192.168.1.100","clientType":"PC","code":"200","eventType":"3","sdkVersion":"18","timestamp":"1452504942126"}

3.2 cURL示例:

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"accid":"test","clientIp":"192.168.1.100","clientType":"PC","code":"200","eventType":"3","sdkVersion":"18","timestamp":"1452504942126"}' 'http://yunxinservice.com.cn/receiveMsg.action'

3.3 消息体中的JSON字段说明:

登出事件消息中,clientIp字段并不一定保证抄送;登录事件消息中的该字段是一定保证抄送的
名称类型说明
eventType String值为3,表示是登出事件的消息
accid String发生登出事件的用户帐号,字符串类型
clientIp String登出时的ip地址
clientType String客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST,字符串类型
code String登出事件的返回码,可转为Integer类型数据
sdkVersion String当前sdk的版本信息,字符串类型
timestamp String登出事件发生时的时间戳,可转为Long型数据

聊天室消息抄送

4. "eventType"="4"

4.1 HTTP示例:

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"attach":"{\"type\":1,\"data\":{\"value\":3}}","eventType":"4","ext":"{\"type\":-2}","fromAccount":"zqpret1101","fromAvator":"","fromClientType":"WEB","fromExt":"","fromNick":"zhangsan","msgTimestamp":"1456123424339","msgType":"CUSTOM","msgidClient":"e4d9065fdb5fde927b16d87b7e861d46","resendFlag":"0","roleInfoTimetag":"1456123382533","roomId":"2016"}

4.2 cURL示例:

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"attach":"{\"type\":1,\"data\":{\"value\":3}}","eventType":"4","ext":"{\"type\":-2}","fromAccount":"zhangsan","fromAvator":"","fromClientType":"WEB","fromExt":"","fromNick":"zhangsan","msgTimestamp":"1456123424339","msgType":"CUSTOM","msgidClient":"e4d9065fdb5fde927b16d87b7e861d46","resendFlag":"0","roleInfoTimetag":"1456123382533","roomId":"2016"}' 'http://yunxinservice.com.cn/receiveMsg.action'

4.3 消息体中的JSON字段说明:

聊天室类型消息中,并不是每个字段都会一定抄送,请注意对各字段的判空处理。
以下为一般情况下必有的字段:
eventType、attach、fromAccount、msgTimestamp、msgType、msgidClient、roomId
名称类型说明
eventType String值为4,表示是聊天室消息
attach String消息内容,若msgType为CUSTOM自定义消息,该字段为JSON格式;否则该字段为普通字符串类型
ext String第三方扩展字段, 格式不限,长度限制4096,字符串类型
fromAccount String消息发送者的账号,字符串类型
fromAvator String发送者的头像,字符串类型
fromClientType String客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST,字符串类型
fromExt String发送者身份的扩展字段,开发者可以自定义,字符串类型
fromNick String发送方昵称,字符串类型
msgTimestamp String消息发送的时间戳
msgType String 消息类型:
TEXT、
PICTURE、
AUDIO、
VIDEO、
LOCATION 、
NOTIFICATION、
FILE、 //文件消息
NETCALL_AUDIO、 //网络电话音频聊天
NETCALL_VEDIO、 //网络电话视频聊天
DATATUNNEL_NEW、 //新的数据通道请求通知
TIPS、 //提示类型消息
CUSTOM //自定义消息
msgidClient String客户端生成的消息id
resendFlag String重发标记:0不是重发, 1是重发
roleInfoTimetag String消息发送者用户名片的最后更新时间,可转为Long型数据
roomId String消息所属的聊天室id,可转为Long型数据
antispam String标识是否被反垃圾,仅在被反垃圾时才有此字段,可转为Boolean类型数据
yidunRes String易盾反垃圾的原始处理细节,只有接入了相关功能易盾反垃圾的应用才会有这个字段。详见以下4.4.1、聊天室:发送文本消息 和 4.4.2、聊天室:发送图片消息的举例说明。

该字段中子字段释义如下:
yidunBusType:0:易盾文本反垃圾业务;1、易盾图片反垃圾业务;2、用户资料反垃圾业务;3、用户头像反垃圾业务。

action:处理结果:检测结果,0:通过,1:嫌疑,2:不通过。 (只有yidunBusType为0或2时,抄送时才有此字段)

labels:具体的反垃圾判断细节:
文本类反垃圾参考:
http://support.dun.163.com/antispam/api/#_18 labels字段的释义
图片类反垃圾参考:
http://support.dun.163.com/antispam/api/#_34 labels字段的释义

4.4 消息抄送详细示例

4.4.1、聊天室:发送文本消息

抄送示例:
{"attach":"聊天室文本消息","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456986458240","msgType":"TEXT","msgidClient":"wangwue-12345-9876543210123","resendFlag":"0","roleInfoTimetag":"0","roomId":"64","yidunRes":"{\"yidunBusType\":0,\"action\":0,\"labels\":[]}"}

attach字段释义:参考P2P消息中的文本消息中attach字段释义

4.4.2、聊天室:发送图片消息

抄送示例:
{"attach":"{\"md5\":\"d0323f8d447abf3df7256bd66f9d5b62\",\"h\":500,\"ext\":\"jpg\",\"size\":9093,\"w\":500,\"name\":\"图片发送于2016-03-02 18:29\",\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyNl84NzBmZjY5Ni0yOGI5LTRiZDgtYjQ4Yy02ZmVjYWI0NjcxM2Y=\"}","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456974764820","msgType":"PICTURE","msgidClient":"abcde-12345-987654","resendFlag":"0","roleInfoTimetag":"0","roomId":"113","yidunRes":"{\"yidunBusType\":1,\"labels\":[{\"level\":0,\"rate\":0.0,\"label\":100},{\"level\":0,\"rate\":0.0,\"label\":200},{\"level\":0,\"rate\":0.0,\"label\":110},{\"level\":0,\"rate\":0.0,\"label\":400},{\"level\":0,\"rate\":0.0,\"label\":300},{\"level\":0,\"rate\":0.0,\"label\":210}]}"}

attach字段释义:参考P2P消息中的图片消息中attach字段释义

4.4.3、聊天室:发送音频消息

抄送示例:
{"attach":"{\"size\":13738,\"ext\":\"aac\",\"dur\":3808,\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyNl9lOWExMmNmMy1lZDhkLTQ2Y2UtYWRiYS1mOTA4ODhjZTliNTM=\",\"md5\":\"35411b36f22077309daec3b970b46e89\"}","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456983964169","msgType":"AUDIO","msgidClient":"abcde-12345-98765432","resendFlag":"0","roleInfoTimetag":"0","roomId":"113"}

attach字段释义:参考P2P消息中的音频消息中attach字段释义

4.4.4、聊天室:发送视频消息

抄送示例:
{"attach":"{\"dur\":1473,\"ext\":\"mp4\",\"h\":480,\"md5\":\"6ba2b50225469d46263ba70736c37cd3\",\"size\":150495,\"url\":\"http:\\/\\/b12026.nos.netease.com\\/MTAxMTAxMA==\\/bmltYV8xNDI5MTVfMTQ1NTY4NzIxMDkyNl9hMmJhOTIzMS1mM2NkLTQ0MTctOWI0OC1kZWRhOTFjNGUzZjA=\",\"w\":360}","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456985454300","msgType":"VIDEO","msgidClient":"abcde-12345-9876543210","resendFlag":"0","roleInfoTimetag":"0","roomId":"64"}

attach字段释义:参考P2P消息中的视频消息中attach字段释义

4.4.5、聊天室:发送地理位置信息

抄送示例:
{"attach":"{\"lat\":30.18704515647036,\"lng\":120.1908686708565,\"title\":\"中国 浙江省 杭州市 网商路 599号\"}","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456986934675","msgType":"LOCATION","msgidClient":"abcde-12345-98765432101234567","resendFlag":"0","roleInfoTimetag":"0","roomId":"64"}

attach字段释义:参考P2P消息中的地理位置消息中attach字段释义

4.4.6、聊天室:发送文件

抄送示例:
{"attach":"{\"ext\":\"ttf\",\"md5\":\"79d62a35fa3d34c367b20c66afc2a500\",\"name\":\"BlizzardReg.ttf\",\"size\":\"91680\",\"url\":\"http:\\/\\/nimtest.nos.netease.com\\/08c9859d-183f-4daa-9904-d6cacb51c95b\"}","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456987025760","msgType":"FILE","msgidClient":"abcde-12345-987654321012345678","resendFlag":"0","roleInfoTimetag":"0","roomId":"64"}

attach字段释义:参考P2P消息中的发送文件消息中attach字段释义

4.4.7、聊天室:发送自定义消息

抄送示例:
{"attach":"{\"myKey1\":\"myValue1\",\"myKey2\":10}","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456987119256","msgType":"CUSTOM","msgidClient":"abcde-12345-9876543210123456789","resendFlag":"0","roleInfoTimetag":"0","roomId":"64"}
attach字段释义:由第三方自己定义并解析相应的Key-Value值


SDK中定义的几类自定义消息释义:
————————————————
剪刀石头布(type = 1):
{"attach":"{\"type\":1,\"data\":{\"value\":3}}","eventType":"4","ext":"{\"type\":-2}","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"IOS","fromExt":"","fromNick":"zhangsan","msgTimestamp":"1456987221992","msgType":"CUSTOM","msgidClient":"aba76741-f5c4-40ce-9f84-4b76c89d9b71","resendFlag":"0","roleInfoTimetag":"1456987212647","roomId":"64"}

attach字段释义:
{
"type":1                                    //type=1表示是剪刀石头布
"data": {
    "value":3                                 //1:石头;2:剪刀;3:布
  }
}

————————————————
贴图表情(type = 3):
{"attach":"{\"type\":3,\"data\":{\"catalog\":\"xxy\",\"chartlet\":\"xxy001\"}}","eventType":"4","ext":"","fromAccount":"zhangsan","fromAvator":"http://b12026.nos.netease.com/MTAxMTAxMA==/bmltYV8xNDI5MTZfMTQzODg2NDI4ODE0Ml81NjM3ZTIxMC1iMjE5LTRhYjgtOGZlOS02MzBjZWFjYmMwZDE=","fromClientType":"REST","fromNick":"zhangsan","msgTimestamp":"1456987840942","msgType":"CUSTOM","msgidClient":"abcde-12345-987654321012345678901","resendFlag":"0","roleInfoTimetag":"0","roomId":"64"}

attach字段释义:
{
"type":3                                    //type=3表示是贴图表情
"data": {
    "catalog":"xxy",                          //贴图所在文件夹的名称
    "chartlet":"xxy002"                       //贴图文件的名称
  }
}

音视频/白板时长消息抄送

5. "eventType"="5"

抄送情景说明

会抄送时长消息的场景:

1. 主被叫接通,正常结束(通话时长大于0),抄送时长、主被叫账号;
2. 主被叫接通,接通的同时立刻挂断(双方都成功进入频道,通话时长为0),抄送时长及主被叫账号。备注:立即挂断时,时长也可能不为03. 主被叫接通时出现异常(如:接通时一方网络出现问题),只有一个人成功进入频道(单人进入,抄送时长为0,status是SINGLE_PARTICIPATE),则只抄送成功进入频道的帐号的时长信息;
4. 特别的,对于超长时长通话(通话时长超过12小时)会按照12小时的间隔将时长信息抄送给客户服务器,少于12小时的音视频会话/互动白板会话均不受影响。

不会抄送时长消息的场景:

1. 被叫拒接;
2. 被叫超时未接听,通话结束;
3. 被叫接听前主叫挂断;

5.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"channelId":"6265489843204131361","createtime":"1458798033925","duration":"25","eventType":"5","live":"1","members":"[{\"accid\":\"lisi\",\"duration\":13},{\"accid\":\"zhangsan\",\"caller\":true,\"duration\":12}]","status":"SUCCESS","type":"AUDIO"}

5.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"channelId":"6265489843204131361","createtime":"1458798033925","duration":"25","eventType":"5","live":"0","members":"[{\"accid\":\"lisi\",\"duration\":13},{\"accid\":\"zhangsan\",\"caller\":true,\"duration\":12}]","status":"SUCCESS","type":"AUDIO"}' 'http://yunxinservice.com.cn/receiveMsg.action'

5.3 消息体中的JSON字段说明:

名称类型说明
channelId String通道号
createtime String音视频通话/白板开始的事件, 可转为13位时间戳
duration String此通通话/白板的通话时长,精确到秒,可转为Integer类型
eventType String为5,表示是实时音视频/白板时长类型事件
live String是否是互动直播的音视频,0:否,1:是
members String 表示通话/白板的参与者:
accid为用户帐号;
如果是通话的发起者的话,caller字段为true,否则无caller字段;
duration表示对应accid用户的单方时长,其中白板消息暂无此单方时长的统计
status String 通话/白板状态:
SUCCESS:表示正常挂断;
TIMEOUT:表示超时;
SINGLE_PARTICIPATE:表示只有一个参与者;
UNKNOWN:表示未知状态
type String 类型:
AUDIO:表示音频通话;
VEDIO:表示视频通话;
DataTunnel:表示白板事件
ext String 音视频发起时的自定义字段,可选,由用户指定
running Boolean 若为true表示超长时长通话的过程中的抄送,缺省或者false表示普通时长通话的抄送或者超长时长通话的最后一次抄送

5.4 消息抄送详细示例

5.4.1. 实时音频通话时长消息

5.4.2. 实时视频通话时长消息

5.4.3. 白板时长消息

5.4.1、实时音频通话时长消息

抄送示例:
{"channelId":"6265489843204131361","createtime":"1458798033925","duration":"25","eventType":"5","live":"0","members":"[{\"accid\":\"lisi\",\"duration\":13},{\"accid\":\"zhangsan\",\"caller\":true,\"duration\":12}]","status":"SUCCESS","type":"AUDIO"}

5.4.2、实时视频通话时长消息

抄送示例:
{"channelId":"6265490045067594274","createtime":"1458798080073","duration":"22","eventType":"5","live":"1","members":"[{\"accid\":\"lisi\",\"duration\":11},{\"accid\":\"zhangsan\",\"caller\":true,\"duration\":11}]","status":"SUCCESS","type":"VEDIO"}

5.4.3、白板时长消息

抄送示例:
{"channelId":"6668145522152249926","createtime":"1473385450643","duration":"12","eventType":"5","members":"[{\"accid\":\"zhangsan\",\"duration\":6},{\"accid\":\"lisi\",\"caller\":true,\"duration\":6}]","status":"SUCCESS","type":"DataTunnel"}

音视频/白板文件下载信息抄送

6. "eventType"="6"

说明:

2018710日(v5.4.0版本)开始,网易云信对音视频录制服务进行录制架构优化,对于超过2小时的音视频通话录制文件,会以2小时为间隔生成文件并进行抄送,需要开发者在处理抄送时了解上述逻辑并做兼容。

6.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"eventType":"6","fileinfo":"[{\"caller\":true,\"channelid\":\"6290737000999815988\",\"filename\":\"xxxxxx.type\",\"md5\":\"a9b248e29669d588dd0b10259dedea1a\",\"mix\":false,\"size\":\"2167\",\"type\":\"gz\",\"vid\":\"1062591\",\"url\":\"http://xxxxxxxxxxxxxxxxxxxx.type\",\"user\":\"zhangsan\"}]"}

6.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"eventType":"6","fileinfo":"[{\"caller\":true,\"channelid\":\"6290737000999815988\",\"filename\":\"xxxxxx.type\",\"md5\":\"a9b248e29669d588dd0b10259dedea1a\",\"mix\":false,\"size\":\"2167\",\"type\":\"gz\",\"vid\":\"1062591\",\"url\":\"http://xxxxxxxxxxxxxxxxxxxx.type\",\"user\":\"zhangsan\"}]"}' 'http://yunxinservice.com.cn/receiveMsg.action'

6.3 消息体中的JSON字段说明:

名称类型说明
eventType String值为6,表示是音视频/白板文件下载信息类型的消息
fileinfo String 可转为JSONArray,其中的字段释义如下:
caller:是否是此通通话的发起者,若是则为true,若不是则没有此字段,可转为Boolean值
channelid:通道号,可转为Long值
filename:文件名,直接存储,混合录制文件filename带有"-mix"标记
md5:文件的md5值
size:文件大小,单位为字符,可转为Long值
type:文件的类型(扩展名),包括:实时音频录制文件(aac)、白板录制文件(gz)、实时视频录制文件(mp4)、互动直播视频录制文件(flv)
url:文件的下载地址,请不要解析该字段
user:用户帐号,若该文件为混合录制文件,则该字段为"0"
mix:是否为混合录制文件,true:混合录制文件;false:单人录制文件
vid:点播文件id,注意白板录制文件(gz)无此字段

单聊消息撤回抄送

7. "eventType"="7"

7.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"clientId":"9e549196-1bb4-4143-a428-d13eaa0cd732","deleteTime":"1487308054709","eventType":"7","from":"zhangsan","fromClientType":"IOS","msgId":"11555996","selfMsg":"撤回了一条消息","sendTime":"1487308046652","to":"lisi"}

7.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"clientId":"9e549196-1bb4-4143-a428-d13eaa0cd732","deleteTime":"1487308054709","eventType":"7","from":"zhangsan","fromClientType":"IOS","msgId":"11555996","selfMsg":"撤回了一条消息","sendTime":"1487308046652","to":"lisi"}' 'http://yunxinservice.com.cn/receiveMsg.action'

7.3 消息体中的JSON字段说明:

名称类型说明
eventType String值为7,表示是一个单聊消息撤回抄送事件
clientId String客户端id,字符串类型
deleteTime String消息撤回时间,13位时间戳
from String用户帐号,消息发送者,字符串类型
fromClientType String消息撤回时的客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST,字符串类型
msgId String撤回的消息的服务端id,可转为Long值
selfMsg String撤回消息的附言,字符串类型
sendTime String消息发送的时间,13位时间戳
to String用户帐号,消息接收者,字符串类型

群聊消息撤回抄送

8. "eventType"="8"

8.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"clientId":"3651689e-53a0-4a1c-beba-7e3703203ef6","deleteTime":"1487309158801","eventType":"8","from":"zhangsan","fromClientType":"IOS","msgId":"927914262574","selfMsg":"撤回了一条消息","sendTime":"1487309155228","to":"13827"}

8.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"clientId":"3651689e-53a0-4a1c-beba-7e3703203ef6","deleteTime":"1487309158801","eventType":"8","from":"zhangsan","fromClientType":"IOS","msgId":"927914262574","selfMsg":"撤回了一条消息","sendTime":"1487309155228","to":"13827"}' 'http://yunxinservice.com.cn/receiveMsg.action'

8.3 消息体中的JSON字段说明:

名称类型说明
eventType String值为8,表示是一个群聊消息撤回抄送事件
clientId String客户端id,字符串类型
deleteTime String消息撤回时间,13位时间戳
from String用户帐号,消息发送者,字符串类型
fromClientType String消息撤回时的客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST,字符串类型
msgId String撤回的消息的服务端id,可转为Long值
selfMsg String撤回消息的附言,字符串类型
sendTime String消息发送的时间,13位时间戳
to String群id,可转为Long值

主播或管理员进出聊天室事件抄送

9. "eventType"="9"

9.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"roomId":"1001","event":"IN","accid":"test","clientIp":"192.168.1.100","clientType":"PC","code":"200","eventType":"9","sdkVersion":"18","timestamp":"1452504942126"}

9.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"roomId":"1001","event":"IN","accid":"test","clientIp":"192.168.1.100","clientType":"PC","code":"200","eventType":"9","sdkVersion":"18","timestamp":"1452504942126"}' 'http://yunxinservice.com.cn/receiveMsg.action'

9.3 消息体中的JSON字段说明:

名称类型说明
eventType String值为9,特别注意这里是9,表示是一个主播或管理员进出聊天室事件
roomId String聊天室id
event String进入或退出。IN:进入聊天室;OUT:主动退出聊天室,或掉线
accid String用户帐号,字符串类型
clientIp String客户端的ip地址,OUT时不保证能提供此字段
clientType String客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST,字符串类型
code String返回码,可转为Integer类型数据
sdkVersion String当前sdk的版本信息,字符串类型
timestamp String事件发生时的时间戳,可转为Long型数据

专线电话通话结束回调抄送

10. "eventType"="10"。需要单独开通,如有需要,请联系相关网易云通信商务经理。

10.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

//双人专线电话示例
{"callback":"{\"callee\":\"15967161234\",\"caller\":\"18605815678\",\"createtime\":1484118614911,\"durationSec\":0,\"initAccount\":\"abcd\",\"legs\":[{\"endTime\":\"2017-01-11 15:10:30\",\"endpoint\":\"18605815678\",\"hangCause\":\"NO_USER_RESPONSE\"},{\"endTime\":\"2017-01-11 15:10:30\",\"endpoint\":\"15967161234\",\"hangCause\":\"NO_USER_RESPONSE\"}],\"session\":\"7c4b7673-4f70-4164-82a0-decb84d77914\",\"starttime\":\"2017-01-11 15:10:30\",\"status\":\"SUCCESS\"}","eventType":"10"}

//专线会议示例
{"callback":"{\"createtime\":1484103244335,\"durationSec\":0,\"initAccount\":\"call817\",\"members\":\"[\\\"18605811234\\\",\\\"18158125678\\\",\\\"15967169012\\\"]\",\"session\":\"4ea1e712-cfd5-4891-b66a-4aa71fe65383\",\"starttime\":\"2017-01-11 10:52:38\",\"status\":\"SUCCESS\"}","eventType":"10"}

10.2 cURL示例

//双人专线电话示例
curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"callback":"{\"callee\":\"15967161234\",\"caller\":\"18605815678\",\"createtime\":1484118614911,\"durationSec\":0,\"initAccount\":\"abcd\",\"legs\":[{\"endTime\":\"2017-01-11 15:10:30\",\"endpoint\":\"18605815678\",\"hangCause\":\"NO_USER_RESPONSE\"},{\"endTime\":\"2017-01-11 15:10:30\",\"endpoint\":\"15967161234\",\"hangCause\":\"NO_USER_RESPONSE\"}],\"session\":\"7c4b7673-4f70-4164-82a0-decb84d77914\",\"starttime\":\"2017-01-11 15:10:30\",\"status\":\"SUCCESS\"}","eventType":"10"}' 'http://yunxinservice.com.cn/receiveMsg.action'
//专线会议示例
curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"callback":"{\"createtime\":1484103244335,\"durationSec\":0,\"initAccount\":\"call817\",\"members\":\"[\\\"18605811234\\\",\\\"18158125678\\\",\\\"15967169012\\\"]\",\"session\":\"4ea1e712-cfd5-4891-b66a-4aa71fe65383\",\"starttime\":\"2017-01-11 10:52:38\",\"status\":\"SUCCESS\"}","eventType":"10"}' 'http://yunxinservice.com.cn/receiveMsg.action'

10.3 消息体中的JSON字段说明:

名称类型说明
eventType String值为10,特别注意这里是10,表示是一个专线电话通话结束回调事件
callback String话单回调的具体内容,为String类型,可转为JSONObject,字段具体释义参考:查询专线电话或会议的详情

短信回执抄送

11. "eventType"="11"

11.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{ "eventType": "11", "objects": [ {  "mobile": "18605818212",  "sendid": "1490",  "result": "DELIVRD",  "sendTime": "2017-06-02 14:40:45",  "reportTime": "2017-06-06 10:40:30",  "spliced": "1","templateId":1234 }, {  "mobile": "18605818212",  "sendid": "1491",  "result": "DELIVRD",  "sendTime": "2017-06-02 14:41:00",  "reportTime": "2017-06-02 10:41:20",  "spliced": "2" ,"templateId":1234} ]}

11.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{ "eventType": "11", "objects": [ {  "mobile": "18605818212",  "sendid": "1490",  "result": "DELIVRD",  "sendTime": "2017-06-02 14:40:45",  "reportTime": "2017-06-06 10:40:30",  "spliced": "1" ,"templateId":1234}, {  "mobile": "18605818212",  "sendid": "1491",  "result": "DELIVRD",  "sendTime": "2017-06-02 14:41:00",  "reportTime": "2017-06-02 10:41:20",  "spliced": "2","templateId":1234 } ]}' 'http://yunxinservice.com.cn/receiveMsg.action'

11.3 消息体中的JSON字段说明:

名称类型说明
mobile String手机号码
sendid String短信发送接口返回的sendid
result String运营商返回的短信发送状态码
sendTime String短信发送时间,调用sms-api接口发送短信的时间
reportTime String运营商返回的短信送达时间
spliced String短信计费条数
templateId Long短信对应的模版ID

短信上行抄送

12. "eventType"="12"

12.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{ "eventType": "12", "objects": [{ "mobile": "18605818212", "content": "TD", "replytime": "2017-09-20 10:40:30"},{ "mobile": "18605818213", "content": "TD", "replytime": "2017-09-20 10:40:30" }]}

12.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{ "eventType": "12", "objects": [{ "mobile": "18605818212", "content": "TD", "replytime": "2017-09-20 10:40:30"},{ "mobile": "18605818213", "content": "TD", "replytime": "2017-09-20 10:40:30" }]}' ‘http://yunxinservice.com.cn/receiveMsg.action’

12.3 消息体中的JSON字段说明:

名称类型说明
mobile String手机号码
content String上行短信内容
replytime String短信回复时间

用户进出音视频/白板房间抄送

13. "eventType"="13"

13.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

{"eventType":"13","event":"1","user":"abcd","channelid":"193384021111101","timestamp":"1510812687298","roomtype":"2"}

13.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"eventType":"13","event":"1","user":"abcd","channelid":"193384021111101","timestamp":"1510812687298","roomtype":"2"}' ‘http://yunxinservice.com.cn/receiveMsg.action’

13.3 消息体中的JSON字段说明:

名称类型说明
event String进入或离开音视频/白板房间:
0:离开音视频/白板房间;
1:进入音视频/白板房间。
可转为Integer值
user String用户账号
channelid String通道号,可转为Long值
timestamp String进入或离开音视频/白板房间的13位时间戳,可转为Long值
roomtype String房间类型:
1:点对点双人房间;
2:多人会议房间;
3:互动直播房间;
4:白板房间。
可转为Integer值

聊天室队列操作事件抄送

14. "eventType"="14"

14.1 HTTP示例

POST  /receiveMsg.action   HTTP/1.1
Host:  yunxinservice.com.cn
Content-Type:  application/json
CurTime: 1440570500855    //当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的毫秒数(String)
MD5: feec2cda404d7417b8b427e95748bb56     //根据请求中的request body计算出来的MD5值
CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01

//==== "qEvent":"1" ====
{"fromWebApi":"true","eventType":"14","roomid":"32","qEvent":"1","operator":"zyy"}

//==== "qEvent":"2" ====
{"transient":"false","elements":"{\"2\":\"1512702269.556135-2\"}","fromWebApi":"false","belongTo":"zyy","eventType":"14","roomid":"101","qEvent":"2","operator":"zyy"}

//==== "qEvent":"3" ====
{"transient":"false","elements":"{\"2\":\"2\"}","fromWebApi":"true","belongTo":"zyy","eventType":"14","roomid":"48","qEvent":"3","operator":"zyy"}

//==== "qEvent":"4" ====
{"keys":"[\"2\"]","fromWebApi":"false","eventType":"14","roomid":"57","qEvent":"4","operator":"zyy"}

//==== "qEvent":"5" ====
{"elements":"{\"1\":\"1512702269.686414-1\"}","fromWebApi":"false","eventType":"14","roomid":"101","qEvent":"5","operator":"zyy"}

//==== "qEvent":"6" ====
{"elements":"{\"1\":\"1512702269.686414-1\"}","fromWebApi":"false","eventType":"14","roomid":"101","qEvent":"6","operator":"zyy"}

//==== "qEvent":"7" ====
{"fromWebApi":"false","eventType":"14","roomid":"101","qEvent":"7","operator":"zyy"}

//==== "qEvent":"8" ====
{"fromWebApi":"false","eventType":"14","roomid":"101","qEvent":"8","operator":"zyy"}

14.2 cURL示例

curl -X POST -H "Content-Type: application/json" -H "CurTime: 1440570500855" -H "MD5: feec2cda404d7417b8b427e95748bb56" -H "CheckSum: 001511b8435e0b28044ca50a78e8f983026c5e01" -d '{"fromWebApi":"true","eventType":"14","roomid":"32","qEvent":"1","operator":"zyy"}' 'http://yunxinservice.com.cn/receiveMsg.action'

14.3 消息体中的JSON字段说明:

名称类型说明
qEvent String具体的操作,可转为int,具体枚举如下:
1:表示INIT操作, 队列初始化
2:表示ADD操作,队列新增key-value
3:表示UPDATE操作,队列更新已有key对应的value
4:表示DELETE操作,队列删除元素
5:表示POLL操作,取出(指定/头)元素
6:表示PEAK操作,查看头上的第一个元素,但是不删除
7:表示LIST操作,排序列出所有元素
8:表示DROP操作,队列清空
fromWebApi String是不是由云信服务端api发起的操作,可转为Boolean类型
roomid String聊天室id,可转为Long值
operator String该操作的发起者accid
belongTo String该元素归属用户的accid
elements String元素的key和对应value
keys String元素的keys,不包含value
transient String这个新元素的提交者operator的所有聊天室连接在从该聊天室掉线或者离开该聊天室的时候,提交的元素是否需要删除。 可转为Boolean值。
true:需要删除;false:不需要删除。