getChatAdministrators
Get a list of all administrators in a chat.
Request
POST /:token/getchatadministrators
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| chat_id | Integer/String | Yes | Unique identifier for the target chat or username |
Response
Returns an array of ChatMember objects.
json
{
"ok": true,
"result": [
{
"user": {
"id": 100000001,
"is_bot": false,
"first_name": "Owner",
"username": "owner"
},
"status": "creator",
"custom_title": "Founder",
"is_anonymous": false
},
{
"user": {
"id": 100000002,
"is_bot": false,
"first_name": "AdminA",
"username": "admin_a"
},
"status": "administrator",
"custom_title": "Tech Lead",
"is_anonymous": false,
"can_manage_chat": true,
"can_post_messages": true,
"can_edit_messages": true,
"can_delete_messages": true,
"can_manage_video_chats": true,
"can_restrict_members": true,
"can_promote_members": false,
"can_change_info": true,
"can_invite_users": true,
"can_pin_messages": true
},
{
"user": {
"id": 123456789,
"is_bot": true,
"first_name": "MyBot",
"username": "my_bot"
},
"status": "administrator",
"custom_title": "",
"is_anonymous": false,
"can_manage_chat": true,
"can_post_messages": false,
"can_edit_messages": false,
"can_delete_messages": true,
"can_manage_video_chats": false,
"can_restrict_members": true,
"can_promote_members": false,
"can_change_info": false,
"can_invite_users": true,
"can_pin_messages": true
}
]
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, e.g. invalid chat_id format |
| 401 | Invalid or expired token |
| 403 | Bot is not a member of this chat and has no access |
