Update an admin
PATCHhttps://api.botsubscription.com/v1/bot:bot_id/:api_key/admins/:admin_id
Update the level of access an admin has.
Request
Path Parameters
bot_id integerrequired
The unique identifier of the bot.
api_key stringrequired
The API key of the bot.
admin_id stringrequired
The unique identifier of the admin. Can't be the owner of the bot.
- application/json
Bodyrequired
admin_level integerrequired
The level of access the admin has. Must be an integer between 2 and 8.
bot_token string
The API token generated from @BotFather in Telegram.
Responses
- 204
- 304
- 400
- 401
- 403
The admin has been successfully updated.
No changes have been made to the admin.
The admin_level provided is invalid. It must be an integer between 2 and 8.
- application/json
- Schema
- Example (auto)
Schema
ok boolean
Default value:
false
request_id string
method string
path string
code integer
Default value:
400
description string
{
"ok": false,
"request_id": "string",
"method": "string",
"path": "string",
"code": 400,
"description": "string"
}
The bot_token provided is invalid. It must be the same as the one generated from @BotFather in Telegram.
- application/json
- Schema
- Example (auto)
Schema
ok boolean
Default value:
false
request_id string
method string
path string
code integer
Default value:
401
description string
{
"ok": false,
"request_id": "string",
"method": "string",
"path": "string",
"code": 401,
"description": "string"
}
You cannot change the owner of the bot.
- application/json
- Schema
- Example (auto)
Schema
ok boolean
Default value:
false
request_id string
method string
path string
code integer
Default value:
403
description string
{
"ok": false,
"request_id": "string",
"method": "string",
"path": "string",
"code": 403,
"description": "string"
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.botsubscription.com");
var content = new StringContent(string.Empty);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear