单聊黑名单

  1. 该功能限于单聊的黑名单功能:
  2. A拉黑BB不能给A发送消息,A可以继续给B发送消息。

参数列表

Variable Meanings
$appId 小米开放平台申请的AppId
$appKey 小米开放平台申请的AppKey
$appSecret 小米开放平台申请的AppSecret
$appAccount 表示查询方在APP帐号系统内唯一ID
$token 查询方的token(使用user.getToken()获取)
$blackAccount 表示被拉黑方在APP帐号系统内唯一ID

拉黑

  • HTTP请求
  1. curl https://mimc.chat.xiaomi.net/api/blacklist/ -XPOST
  2. -d '{"blackAccount":"$blackAccount"}'
  3. -H "appId:$appId"
  4. -H "appKey:$appKey"
  5. -H "appSecret:$appSecret"
  6. -H "appAccount:$appAccount"
  7. -H "Content-Type: application/json"
  8. curl https://mimc.chat.xiaomi.net/api/blacklist/ -XPOST
  9. -d '{"blackAccount":"$blackAccount"}'
  10. -H "token:$token"
  11. -H "Content-Type: application/json"
  • JSON结果
  1. {
  2. "code":200,
  3. "message":"success",
  4. "data":null,
  5. }

取消拉黑

  • HTTP 请求
  1. curl https://mimc.chat.xiaomi.net/api/blacklist/?blackAccount=$blackAccount -XDELETE
  2. -H "appId:$appId"
  3. -H "appKey:$appKey"
  4. -H "appSecret:$appSecret"
  5. -H "appAccount:$appAccount"
  6. -H "Content-Type: application/json"
  7. curl https://mimc.chat.xiaomi.net/api/blacklist/?blackAccount=$blackAccount -XDELETE
  8. -H "token:$token"
  9. -H "Content-Type: application/json"
  • JSON结果
  1. {
  2. "code":200,
  3. "message":"success",
  4. "data":null,
  5. }

是否拉黑

  • HTTP 请求
  1. curl https://mimc.chat.xiaomi.net/api/blacklist/?blackAccount=$blackAccount -XGET
  2. -H "appId:$appId"
  3. -H "appKey:$appKey"
  4. -H "appSecret:$appSecret"
  5. -H "appAccount:$appAccount"
  6. -H "Content-Type: application/json"
  7. curl https://mimc.chat.xiaomi.net/api/blacklist/?blackAccount=$blackAccount -XGET
  8. -H "token:$token"
  9. -H "Content-Type: application/json"
  • JSON结果
  1. {
  2. "code":200,
  3. "message":"success",
  4. "data":{
  5. "isBlack":true/false
  6. },
  7. }