连接信息: urlqueryString 中加上 token=你的token&app=你的appKey
注: 要加的地方有两个, 都要加上, 本地有可能不加就能连接成功, 但线上, 肯定会失败!!!!!!
false
{
error:"Error Message"
}
{
id: '用户AccountID或群组ID'
}
1 成功 0 失败
{
... : ...
}
{
}
{
user:[
{
id: "",
num: int
}
],
group:[
{
id: "",
num: int,
ispush: boolean,
at: false,
msgid: 123123123, // at消息id,当为at消息时有此字段
time: timeStamp // at消息时间戳当为at消息时有此字段
}
],
num: int, // 未读总计数
notPush: int // 不通知的计数
}
{
}
{
count: int,
notPush: int
}
{
type: string, // 1 : 用户, 2. 群组
id: string // 用户AccountId 或者 群组Id
}
1
{
}
1
{
}
[
{
type:int, //inboxType,
value:string,// post,system,task,calendar,knowledge
time: string,
msg: {
con: string
},
count: int // 未读计数
}
]
{
touser: string, //接收者 AccountId
msg: string, //消息文本
type:int, // 1 文本 2 图片 3 语音 4 附件 5 卡片
file:{ // 可选
url: string,
id: string, // FileID
aid: string, //
ft: string,
key: string,
hash: string,
size: int,
name: string,
len: len,
isEmotion: boolean // true or false
},
card:{
title: string, // 呈现一级文本(必须);
md: string, //"task","calendar","post","vote","" 明道内置应用 时存在该字段(必须),否则不存在
text: string, // 呈现二级文本
url: string, // 跳转链接(必须)全路径
pic: string, // 明道应用时, 该字段不存在, 非明道应用,为应用自定义图片
entityid: string // 实体id, 如taskid, calendarid,postid 或其他应用内实体id
},
refer:{
msgid: String
}
}
//成功时
{
id: string // messageid
}
//失败时
{
error: 'message'
}
/*
"not my contract" //不是我的联系人(包括同事和好友)
"database error" //数据库错误
"from user not found" // 当前用户没找到
*/
{
togroup: string, //接收者 AccountId
msg: string, //消息文本
type: int, // 1 文本 2 图片 3 语音 4 附件 5 卡片
file: { // 可选
url: string,
id: string, // FileID
aid: string, //
ft: string,
key: string,
hash: string,
size: int,
name: string,
len: len,
isEmotion: boolean // true or false
},
card: {
title: string, // 呈现一级文本(必须);
md: string, //"task","calendar","post","vote","" 明道内置应用 时存在该字段(必须),否则不存在
text: string, // 呈现二级文本
url: string, // 跳转链接(必须)全路径
pic: string, // 明道应用时, 该字段不存在, 非明道应用,为应用自定义图片
entityid: string // 实体id, 如taskid, calendarid,postid 或其他应用内实体id
},
refer:{
msgid: String
}
}
{
//成功时
{
id: string // messageid
}
//失败时
{
error: 'message'
}
}
/*
"not in group" //不在该群组中
"group not found" //群组没找到
"from user not found" // 当前用户没找到
"database err" //数据库错误
*/
{
type : int // 1 图片 2 附件 3 语音
}
{
token: string , // token
key: string // 规则是 accountid/year(2016)/month(6)/day(14)
}
{
type: int, // 1 用户, 2 群组 , 3-99 Inbox应用消息 3:系统消息 4 动态消息 5 日程消息 6 任务消息 7知识消息 100 公众号
id: string // 用户AccountId 或 群组Id
}
1
{
aid: string,
messageId: string
}
1
{
toUser: array, //被at的用户AccountId []
gid: string, // groupid
messageId: string
}
1
{
type: "类型字符串" //system post calendar task knowledge
value: 0, //剩余未读计数
clear: boolean //是否执行清除操作, 移动端传false
}
{
messageId: string
}
{
}
{
aid: string // 发送者AccountId
}
{
from: string, // 发送抖屏这AccountId
gid: string // 群组Id
}
{
id: string, // 消息id
from: string, // 发送者AccountId
uname: string, // 发送者姓名
logo: string, // 发送者头像url
to: string, //接收者AccountId
type: int, // 消息类型 1 文本 2 图片 3 语音 4 附件 5 卡片
msg: {
con: string, //消息文本内容
files:{ // 可选
url: string,
id: string, // FileID
aid: string, //
ft: string,
key: string,
hash: string,
size: int,
name: string,
len: len,
isEmotion: boolean // true or false
}
},
card:{
title: string, // 呈现一级文本(必须);
md: string, //"task","calendar","post","vote","kcfile","kcfolder","" 明道内置应用 时存在该字段(必须),否则不存在
text: string, // 呈现二级文本
url: string, // 跳转链接(必须)全路径
pic: string, // 明道应用时, 该字段不存在, 非明道应用,为应用自定义图片
entityid: string // 实体id, 如taskid, calendarid,postid 或其他应用内实体id
},
app: {
appid: "",
name: "",
url: ""
},
refer: {
msgid:string, // 消息Id
msg:string, // 消息文本
time: Date, //消息时间
user: {
id: string,
name: string,
avatar: string
}
},
time: string // date 类型
}
{
id: string, // 消息id
from: string, // 发送者AccountId
uname: string, // 发送者姓名
logo: string, // 发送者头像url
to: string, //groupId
groupname: string, // 群组名称
avatar: string, //群组头像
type: int, // 消息类型 1 文本 2 图片 3 语音 4 附件 5 卡片
sysType: int, // 系统消息类型, 1. 加人 2. 减人 3. 重命名群组 4.其他
isPush:boolean //是否接受消息推送
msg: {
con: string, //消息文本内容
files:{ // 可选
url: string,
id: string, // FileID
aid: string, //
ft: string,
key: string,
hash: string,
size: int,
name: string,
len: len,
isEmotion: boolean // true or false
}
},
card:{
title: string, // 呈现一级文本(必须);
md: string, //"task","calendar","post","vote","kcfile","" 明道内置应用 时存在该字段(必须),否则不存在
text: string, // 呈现二级文本
url: string, // 跳转链接(必须)全路径
pic: string, // 明道应用时, 该字段不存在, 非明道应用,为应用自定义图片
entityid: string // 实体id, 如taskid, calendarid,postid 或其他应用内实体id
},
app: {
appid: "",
name: "",
url: ""
},
refer: {
msgid : string, // 消息Id
msg : string, // 消息文本
time: Date, //消息时间
user: {
id: string,
name: string,
avatar: string
}
},
time: string // date 类型
}
{
id: string, //groupid
name: string, //群组名称
logo: string,//群组头像
uCount: int, //群组成员数
admins: [],//群组管理员
isPost: boolean, //是否为动态群
cuser: string, // 群组创建者
isPush: true
}
{
id: string, //groupid
name: string, //群组名称
users: [ //被加入的用户
{
AccountID:string,
Email:string,
Fullname:string,
Avatar:string
}
...
]
}
{
oldName: string, //原群组名称
name: string,//新群组名称
gid: string, //groupid
user: {
id: string, //操作者AccountId
logo: string //操作者头像
}
}
{
id: string,//群组Id
name: string //群组名称
}
{
id: string, //群组id
name: string//群组名称
aid: string //被移除用户AccountId
}
{
removedAid: string,//被移除管理员的用户AccountId
aid: string,//操作者AccountId
gid: string //群组Id
}
{
addAid: string, // 被添加为管理员
gid: string // 群组ID
}
{
gid: string, //groupid
aid: string, //操作者id
isPush: boolean//是否push
}
{
}
{
type: int, // 1 用户 2 群组
id: string //type=1:用户Accountid type=2:群组id
}
{
time: int, // 消息发送Unix时间戳
type : string, // system post calendar task knowledge
value: int //消除后的计数
}
{
id: sessionID //type为1时 id=用户Accountid,type为2时, id =群组id,
type: int, // 1 用户 2 群组 3 系统消息 4 动态消息 5 日程消息 6 任务消息 7 知识消息 .... 100 公众号
}
{
aid: string, //用户AccountId
type: string, //mentioned comment systemmessage calendarmessage taskmessage taskcomment taskmention taskreply folderreply foldermention foldercomment addressbookmessage kcemessage
dtype: int //0 动态消息, 1 系统消息, 2 日程消息 3 任务消息, 4 知识消息
}
{
from: {
accountId: string, // 发送者id
fullname: string, // 发送者名称
avatar: string //头像路径
},
to: {
//如果是群
gid: string // 群组id
//如果是用户
aid: string // 用户id
},
message:string //消息文本
}
{
//发送者
from:{
accountId: '', // 发送者id
fullname: '', // 发送者名称
avatar: '' //头像路径
},
type: 1, // 1 用户, 2 群组(群聊)
message: '',
id: 'sessionid', // 用户accountid 或 群组id
name: '呈现的用户名或群组名称',
logo: '呈现的用户头像或群组头像'
}
{
groupid:"群组id",
operator:{
accountId:"",
fullName:"",
avatar:""
}
}
{
groupid:"群组id",
operator:{
accountId:"",
fullName:"",
avatar:""
}
}
{
messageId:"messageId"
}
注: 在发送用户消息和群组消息时,send message 和send group message 时 如果返回结果 为 {error:'removeit'} 则说明该用户与我既不是好友也不是同事 或者 我已不在该群中