contacts/retrieve-all-friends

Description

Request URL

  • http://127.0.0.1:8888/api/

Request Method

  • POST

Parameters

Parameter NameRequiredParameter TypeDescription
typeYesintAPI ID
dbNameNostringName of the database, with lower priority than dbHandle
dbHandleNointDatabase handle, with higher priority than dbName
sqlYesstringsql

Request Example

Retrieve a comprehensive list of all friends, including those within chat room
{
 "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;"
}

Retrieve the list of contacts from your Contances
{
"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;"
}

Retrieve chat room list
{
"type": 10058,
"dbName": "MicroMsg.db",
"sql": "SELECT UserName,Remark, NickName,PYInitial,RemarkPYInitial FROM Contact t1 WHERE t1.Type in(2,2050);"
}

Determining whether a group chat is an enterprise group.
{
"type": 10058,
"dbName": "MicroMsg.db",
"sql": "SELECT UserName,Remark, NickName,PYInitial,RemarkPYInitial FROM Contact t1 WHERE t1.Type = 2050 and t1.UserName='xxxx@chatroom';"
}

Obtain Nicknames from Enterprise Groups.
{
"type": 10058,
"dbName": "OpenIMContact.db",
"sql": "SELECT Remark, NickName FROM OpenIMContact t1 where UserName = 'xxxxx@openim'"
}

Return Example

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

Return Parameter Description

Parameter NameParameter TypeDescription
error_codeintError code
descriptionstringError Description
datajsonBusiness data

Remark