Use this method to upload a

POST /uploadStickerFile

Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.

Body Required

  • user_id integer Required

    User identifier of sticker file owner

  • png_sticker Required

    This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

Responses

  • default
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is false.

    • error_code integer Required
    • description string Required
    • parameters object

      Contains information about why a request was unsuccessful.

      Hide parameters attributes Show parameters attributes object
      • migrate_to_chat_id integer

        Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

      • retry_after integer

        Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

  • 200
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is true.

    • result object Required

      This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

      Maximum file size to download is 20 MB

      Hide result attributes Show result attributes object
      • file_id string Required

        Identifier for this file, which can be used to download or reuse the file

      • file_unique_id string Required

        Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

      • file_size integer

        Optional. File size, if known

      • file_path string

        Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.

POST /uploadStickerFile
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/uploadStickerFile \
 -H "Content-Type: multipart/form-data" \
 -F "user_id=42"
Request example
{
  "user_id": 42
}
Request examples
{
  "user_id": 42
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "file_id": "string",
    "file_unique_id": "string",
    "file_size": 42,
    "file_path": "string"
  }
}
Response examples (200)
{
  "ok": true,
  "result": {
    "file_id": "string",
    "file_unique_id": "string",
    "file_size": 42,
    "file_path": "string"
  }
}