Update Bot Chat
PATCH
/v1/bots/{bot_id}/chats/{chat_id}
const url = 'https://api.cloud.agentums.ru/v1/bots/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/chats/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"proactive_allowed":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.cloud.agentums.ru/v1/bots/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/chats/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "proactive_allowed": true }'Пока правится только согласие писать в чат первым — и давать его может ТОЛЬКО владелец: это его бот и его репутация в чужом чате.
Authorizations
Заголовок раздела «Authorizations»Parameters
Заголовок раздела «Parameters»Path Parameters
Заголовок раздела «Path Parameters»bot_id
required
Bot Id
string format: uuid
chat_id
required
Chat Id
integer
Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Responses
Заголовок раздела «Responses»Successful Response
Media typeapplication/json
BotChatOut
Карточка группы для экрана владельца.
member_count и known_count идут ПАРОЙ намеренно. Состав группы Telegram боту не
отдаёт (есть только getChatAdministrators и getChatMember по уже известному id), поэтому
реестр неполон всегда. Одно known_count выдало бы четверых известных за всю группу —
интерфейс обязан показывать «знаем 4 из 12», а не «4 участника».
object
chat_id
required
Chat Id
integer
collection_id
Collection Id
string
description
Description
string
known_count
Known Count
integer
last_seen_at
Last Seen At
string
member_count
Member Count
integer
note_object_id
Note Object Id
string
synced_at
Synced At
string
title
required
Title
string
Example
{ "collection_id": "", "description": "", "known_count": 0, "last_seen_at": "", "member_count": 0, "note_object_id": "", "synced_at": ""}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}