Create
POST
/v1/telegram-imports
const url = 'https://api.cloud.agentums.ru/v1/telegram-imports';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"bot_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","caption":"","chat_id":1,"file_id":"example","filename":"example","message_id":1,"message_thread_id":0,"mime":"","notify_on_completion":false,"sender_id":1,"size":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.cloud.agentums.ru/v1/telegram-imports \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "bot_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "caption": "", "chat_id": 1, "file_id": "example", "filename": "example", "message_id": 1, "message_thread_id": 0, "mime": "", "notify_on_completion": false, "sender_id": 1, "size": 1 }'Сохранить подтверждённое вложение зарегистрированного Telegram-бота до 2 ГиБ.
Владелец берётся из авторизации, размер и отправитель сверяются с полученным сообщением. Возвращает ID фонового импорта; токен бота в запросе не принимается.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
TelegramImportInit
object
caption
Caption
string
chat_id
required
Chat Id
integer
file_id
required
File Id
string
filename
required
Filename
string
message_id
required
Message Id
integer
message_thread_id
Message Thread Id
integer
mime
Mime
string
notify_on_completion
Notify On Completion
boolean
sender_id
required
Sender Id
integer
size
required
Size
integer
Responses
Заголовок раздела «Responses»Successful Response
Media typeapplication/json
TelegramImportOut
object
Example
{ "caption_dispatch_status": "none", "status": "queued"}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" } ]}