通讯录/获取所有好友列表

简要描述

请求URL

  • http://127.0.0.1:8888/api/

请求方式

  • POST

参数

参数名必选类型说明
typeint接口编号
dbNamestring数据库名称,优先级低于dbHandle
dbHandleint数据库句柄,优先级高于dbName
sqlstringsql

请求示例

获取所有好友列表,以及所有群里的好友列表
{
 "type": 10058,
 "dbName": "MicroMsg.db",
 "sql": "SELECT chl.smallHeadImgUrl, c.UserName, c.Remark, c.nickName FROM Contact c LEFT JOIN ContactHeadImgUrl chl ON c.UserName = chl.usrName;"
}

只获取通讯录好友列表
{
"type": 10058,
"dbName": "MicroMsg.db",
"sql": "SELECT UserName,Remark,NickName,PYInitial,RemarkPYInitial,t2.smallHeadImgUrl FROM Contact t1 LEFT JOIN ContactHeadImgUrl t2 ON t1.UserName = t2.usrName WHERE t1.VerifyFlag = 0 AND (t1.Type = 3 OR t1.Type > 50) and t1.Type != 2050 AND t1.UserName NOT IN ('qmessage', 'tmessage') ORDER BY t1.Remark DESC;"
}

只获取群
{
"type": 10058,
"dbName": "MicroMsg.db",
"sql": "SELECT UserName,Remark, NickName,PYInitial,RemarkPYInitial FROM Contact t1 WHERE t1.Type in(2,2050);"
}

判断群聊是否是企业群
{
"type": 10058,
"dbName": "MicroMsg.db",
"sql": "SELECT UserName,Remark, NickName,PYInitial,RemarkPYInitial FROM Contact t1 WHERE t1.Type = 2050 and t1.UserName='xxxx@chatroom';"
}

获取企业群中的昵称
{
"type": 10058,
"dbName": "OpenIMContact.db",
"sql": "SELECT Remark, NickName FROM OpenIMContact t1 where UserName = 'xxxxx@openim'"
}

返回示例

  {
    "data": {
      "status": 0,
      "desc": "",
    }
  }

返回参数说明

参数名类型说明
error_codeint错误代码
descriptionstring错误描述
datajson业务数据

备注