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. |
Example:
Requests
json{ "method": "getChatAdministrators", "chat_id": "90090684270838031", "app_id": "90090684293000559", "reference": "123456789" }
javaapi.getChatAdministrators(incomingMsg.getChat().getId());
javascriptapi.getChatAdministrators(chat.id);
pythonnapi.get_chat_administrators("chatId")
Response
json{ "method": "chatAdministrators", "app_id": "90090684293000559", "chatAdministrators": { "chat": { "id": "90090684270838031" }, "administrators": [ { "id": "90091783822039252" }, { "id": "90092883286353982" } ] }, "reference": "123456789", }