Перейти к содержимому

Create

POST
/v1/telegram-imports
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 фонового импорта; токен бота в запросе не принимается.

Media typeapplication/json
TelegramImportInit
object
bot_id
Any of:
string format: uuid
caption
Caption
string
"" <= 1024 characters
chat_id
required
Chat Id
integer
file_id
required
File Id
string
>= 1 characters <= 1024 characters
filename
required
Filename
string
>= 1 characters <= 512 characters
message_id
required
Message Id
integer
> 0
message_thread_id
Message Thread Id
integer
0
mime
Mime
string
"" <= 255 characters
notify_on_completion
Notify On Completion
boolean
sender_id
required
Sender Id
integer
size
required
Size
integer
> 0 <= 2147483648

Successful Response

Media typeapplication/json
TelegramImportOut
object
caption_dispatch_error
Any of:
string
caption_dispatch_status
Caption Dispatch Status
string
default: none
Allowed values: none queued running done failed
error
Any of:
string
filename
required
Filename
string
id
required
Id
string format: uuid
object_id
Any of:
string format: uuid
size
required
Size
integer
status
required
Status
string
Allowed values: queued saving ready failed
Example
{
"caption_dispatch_status": "none",
"status": "queued"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
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"
}
]
}