getChatMemberCount
获取聊天中的成员数量。
请求
POST /:token/getchatmembercount
参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| chat_id | Integer/String | 是 | 目标聊天的唯一标识符或用户名 |
响应
返回聊天成员数量(Integer)。
json
{
"ok": true,
"result": 256
}错误码
| 错误码 | 描述 |
|---|---|
| 400 | 请求参数错误,如 chat_id 格式不正确 |
| 401 | Token 无效或已过期 |
| 403 | Bot 不是该聊天的成员,无权获取信息 |
| 404 | 聊天不存在 |
| 500 | 服务器内部错误 |
示例
cURL
bash
curl -X POST "https://api.example.com/<token>/getchatmembercount" \
-H "Content-Type: application/json" \
-d '{
"chat_id": -1001234567890
}'