Skip to content

IFiles

v1 stable

/IFiles/v1/

Upload sticker and emoji files once and use them by fileId, like Telegram's uploadStickerFile. An upload is kept for 24 hours; at most 100 unclaimed uploads per bot.

Authentication required

All endpoints require Authorization: Bot <token> header. Get a token →

GET /IFiles/v1/Get

Describes a file the bot uploaded or owns, or any sticker or emoji file: its size, type and a download URL.

Query Parameters

Field Type
fileId
uuid

Response BotFileV1

Field Type
fileId uuid
size int64
contentType string
url string

Errors

Status Code Description
404 not_found The pack, item or file does not exist.

Example

curl -X GET \
     -H "Authorization: Bot YOUR_TOKEN" \
     "https://gateway.argon.zone/IFiles/v1/Get?fileId=..."
POST /IFiles/v1/Upload

Uploads a sticker, emoji or thumbnail file (multipart: file, purpose) for IExpressions/AddItem to take by fileId, any number of times, within 24 hours. PNG, WEBP, TGS, Lottie JSON or WEBM; thumb takes WEBP only.

Form Fields multipart/form-data

Each field is a text part; a list repeats its field once per value, or sends one field holding a JSON array. A file field is a part of that name, or a text field holding attach://<part> that names another part of the request. Where a route reuses uploads, it also takes the fileId of an IFiles/Upload. See Stickers & Custom Emoji → Files.

Field Type
file
file

A file: the part of this name itself, or a text field holding attach://<name> (another part of the request). A fileId is not accepted here.

purpose
"sticker" | "emoji" | "thumb"
<part>
file optional

A part an attach://<name> reference names.

Response BotFileV1

Field Type
fileId uuid
size int64
contentType string
url string

Errors

Status Code Description
400 invalid_format A title, slug, name, emoji, keyword or external id is not acceptable, or the file is not (format, dimensions, duration, frame rate).
400 invalid_request The form could not be read: a field is missing or malformed, or an attach:// reference names no part.
413 too_large The request, or a file in it, is over the size limit.
422 quota_exceeded The space's packs or slots, the pack, or the bot's unclaimed uploads are full.

Example

curl -X POST \
     -H "Authorization: Bot YOUR_TOKEN" \
     -F "file=@./file" \
     -F "purpose=sticker" \
     https://gateway.argon.zone/IFiles/v1/Upload