Use this method to get chat administrators.
Field | Type | Required | Description |
method | String | Yes | "getChatAdministrators" |
app_id | String | Yes | Unique identifier for App. |
chat_id | String | Yes | Unique identifier for chat Group or Channel where the member belongs. |
reference | String | Optional | Unique identifier for the request. This reference will be echoed in the response. |
Preconditions for API Functionality
The following table outlines the preconditions that must be met for the API to function correctly. Failure to meet these conditions may result in errors or unexpected behavior.
Condition | Description |
API must have "Manage Chats" permission | The API needs "Manage Chats" permissions to manage chats within the app. |
API must be a moderator or an admin in the chat | The API requires admin privileges in the chat to execute view or creation actions. |
Response
chatAdministrators
On success, the chatAdministrators message will be received.
Field | Type | Returned | Description |
method | String | Yes | "chatAdministrators" |
app_id | String | Yes | Unique identifier for App. |
chatMember | Yes | chatAdministrators Object. | |
reference | String | Optional | Unique identifier echoed from the request. |
SDK Mapping β getChatAdministrator
SDK | Request Method | Response 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
Requests
json{ "method": "getChatAdministrators", "chat_id": "90090684270838031", "app_id": "90090684293000559", "reference": "123456789" }
javaapi.getChatAdministrators("90090684298937728",Long.valueOf("90090684298937728"),null);
javascriptapi.getChatAdministrators("90090684298937728", "90090684298937728", null);
pythonnapi.get_chat_administrators(chat_id="90090684298937728",app_id=90090684298937728,reference=None)
Response
json{ "method": "chatAdministrators", "app_id": "90090684293000559", "chatAdministrators": { "chat": { "id": "90090684270838031" }, "administrators": [ { "id": "90091783822039252" }, { "id": "90092883286353982" } ] }, "reference": "123456789", }