Lists the administrators of a group or channel.
Request
method is "getChatAdministrators".Field | Type | Required | Description |
chat_id | String | Yes | The group or channel to list administrators for. |
app_id | String | Yes | The app the chat belongs to. |
reference | String | Optional | Your id for this request. Echoed back in the response. |
Preconditions
Requirement | Why |
"Manage Chats" permission | Needed to read chat membership. |
Moderator or admin in the chat | The administrator list is only visible to privileged roles. |
Response
chatAdministrators
Field | Type | Returned | Description |
method | String | Yes | "chatAdministrators" |
chatAdministrators | Yes | Holds the chat and an administrators array of user ids. | |
app_id | String | Yes | Echoed from the request. |
reference | String | Optional | Echoed from the request. |
SDKs
SDK | Call | Callback |
Java | api.getChatAdministrators(chatId, appId, reference); | onChatAdministrators(ChatAdministrators chatAdministrators) |
JavaScript | api.getChatAdministrators(chatId, appId, reference); | onChatAdministrators(chatAdministrators) |
Python | napi.get_chat_administrators(chat_id=chat_id, app_id=app_id, reference=reference) | on_chat_administrators(self, chat_administrators) |
Example
Request
json{ "method": "getChatAdministrators", "chat_id": "90090684270838031", "app_id": "90090684293000559", "reference": "123456789" }
javaapi.getChatAdministrators("90090684270838031", "90090684293000559", "123456789");
javascriptapi.getChatAdministrators("90090684270838031", "90090684293000559", "123456789");
pythonnapi.get_chat_administrators(chat_id="90090684270838031", app_id="90090684293000559", reference="123456789")
Response
json{ "method": "chatAdministrators", "app_id": "90090684293000559", "reference": "123456789", "chatAdministrators": { "chat": { "id": "90090684270838031" }, "administrators": [ { "id": "90091783822039252" }, { "id": "90092883286353982" } ] } }