Skip to content

获取群成员详情 ​

查询群里某个成员的详细资料。

接口地址: POST /getChatRoomMemberInfo

说明与注意 ​

  • userList 一次只能传一个成员,多人分次调用并加间隔。

请求参数 ​

参数名必选类型说明
wId是string登录实例标识
chatRoomId是string群 ID
userList是string群成员微信 ID

请求示例 ​

http
POST {BASE_URL}/getChatRoomMemberInfo
Authorization: Bearer <你的调用凭证>
Content-Type: application/json

{
  "wId": "4941c159-48dc-4271-b0d0-f94adea39127",
  "chatRoomId": "232323232@chatroom",
  "userList": "wxid_daydt60mc0ny22"
}
bash
curl -X POST '{BASE_URL}/getChatRoomMemberInfo' \
  -H 'Authorization: Bearer <你的调用凭证>' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "wId": "4941c159-48dc-4271-b0d0-f94adea39127",
  "chatRoomId": "232323232@chatroom",
  "userList": "wxid_daydt60mc0ny22"
}'
python
import requests

url = "{BASE_URL}/getChatRoomMemberInfo"
headers = {"Authorization": "Bearer <你的调用凭证>", "Content-Type": "application/json"}
body = """{
  "wId": "4941c159-48dc-4271-b0d0-f94adea39127",
  "chatRoomId": "232323232@chatroom",
  "userList": "wxid_daydt60mc0ny22"
}"""

resp = requests.post(url, headers=headers, data=body.encode("utf-8"))
print(resp.text)
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String url = "{BASE_URL}/getChatRoomMemberInfo";
String body = "{\n" +
    "  \"wId\": \"4941c159-48dc-4271-b0d0-f94adea39127\",\n" +
    "  \"chatRoomId\": \"232323232@chatroom\",\n" +
    "  \"userList\": \"wxid_daydt60mc0ny22\"\n" +
    "}";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create(url))
    .header("Authorization", "Bearer <你的调用凭证>")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
php
<?php

$url = '{BASE_URL}/getChatRoomMemberInfo';
$body = <<<'JSON'
{
  "wId": "4941c159-48dc-4271-b0d0-f94adea39127",
  "chatRoomId": "232323232@chatroom",
  "userList": "wxid_daydt60mc0ny22"
}
JSON;

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer <你的调用凭证>',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

成功响应 ​

json
{
  "message": "成功",
  "code": "1000",
  "data": [
    {
      "userName": "wxid_daydt6xx1c0ny22",
      "nickName": "北京123",
      "remark": "",
      "signature": "",
      "sex": 0,
      "aliasName": "example_alias",
      "country": null,
      "bigHead": "https://example.com/avatar/big.jpg",
      "smallHead": "https://example.com/avatar/small.jpg",
      "labelList": null,
      "v1": "v3_020b3826fd0301000009b4df5b5000000501ea9a3dba12f95f6b60a0536a1adb69d4c980f5186cb7f0dbb8ee9b5f0cdcf4a075737d607e1803aededdd3a719b452a84dbf83c12e07b110dae9260e6ac806c82f380ad6085660a9@stranger",
      "v2": ""
    }
  ]
}

错误响应 ​

json
{
  "message": "失败",
  "code": "1001",
  "data": null
}

响应参数 ​

参数名类型说明
codestring1000 成功;其他值都是失败,通常是 1001
messagestring反馈信息
dataarray成员详情列表
data[].userNamestring微信 ID
data[].nickNamestring昵称
data[].remarkstring备注
data[].signaturestring个性签名
data[].sexint性别
data[].aliasNamestring微信号
data[].countrystring/null国家
data[].bigHeadstring大头像 URL
data[].smallHeadstring小头像 URL
data[].labelListstring/null标签列表
data[].v1string加好友凭证 1
data[].v2string加好友凭证 2