Add a chat
POSThttps://api.botsubscription.com/v1/bot:bot_id/:api_key/chats
Add a new chat to the bot.
Request
Path Parameters
bot_id integerrequired
The unique identifier of the bot.
api_key stringrequired
The API key of the bot.
- application/json
Bodyrequired
chat_id integerrequired
The unique identifier of the chat.
chat_name stringrequired
The name of the chat.
chat_type stringrequired
The type of the chat. Must be one of 'private', 'group', 'supergroup', or 'channel'.
Possible values: [group
, supergroup
, channel
]
Responses
- 201
- 409
The chat has been successfully added.
- application/json
- Schema
- Example (auto)
Schema
ok boolean
Default value:
true
request_id string
method string
path string
code integer
Default value:
201
result object
{
"ok": true,
"request_id": "string",
"method": "string",
"path": "string",
"code": 201,
"result": {
"chat_id": 0,
"chat_name": "string",
"chat_type": "group"
}
}
The chat_id provided is already added to the bot.
- application/json
- Schema
- Example (auto)
Schema
ok boolean
Default value:
false
request_id string
method string
path string
code integer
Default value:
409
description string
{
"ok": false,
"request_id": "string",
"method": "string",
"path": "string",
"code": 409,
"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");
request.Headers.Add("Accept", "application/json");
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