> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram API

> Các tùy chọn để đăng bài bằng Telegram API

## Đăng bài lên Telegram

JSON cho một bài đăng cơ bản với liên kết và hình ảnh bằng Telegram API:

```json Telegram Post theme={"system"}
{
  "post": "The best Telegram message ever #best https://www.telegram.com", // empty string is allowed
  "mediaUrls": ["https://img.ayrshare.com/012/gb.jpg"],
  "platforms": ["telegram"]
}
```

Telegram sẽ tự động xem trước liên kết trong kênh hoặc nhóm trừ khi có kèm hình ảnh hoặc video. Trong ví dụ trên, hình ảnh sẽ hiển thị. Việc bỏ hình ảnh sẽ khiến bản xem trước liên kết hiển thị.

Nếu video của bạn không kết thúc bằng phần mở rộng video đã biết như mp4, vui lòng sử dụng tham số `isVideo`. Xem [endpoint /post](/apis/post/post) để biết chi tiết.

Xem [Telegram Media Guidelines](/media-guidelines/telegram) và [Telegram Authorization](/dashboard/connect-social-accounts/telegram) để biết thêm thông tin.

## GIF động

Chỉ được phép sử dụng một URL với GIF động Telegram. Nếu URL phương tiện không kết thúc bằng ".gif" hoặc ".GIF", hãy đặt trường `isVideo` thành `true`.

```json Telegram Animated GIF theme={"system"}
{
    "randomPost": true,
    "platforms": [
        "telegram"
    ],
    "isVideo": true,    // Set to true if the mediaURL does not end in .gif or .GIF
    "mediaUrls": ["https://img.ayrshare.com/012/cat.gif"]
}
```

## Nhắc tên (Mention) trên Telegram

Nhắc tên một handle Telegram khác bằng cách thêm `@handle` vào nội dung bài đăng. Ví dụ:

```json Telegram Post with Mention theme={"system"}
{
  "post": "The best Telegram image post ever @handle",
  "platforms": ["telegram"]
}
```

<Warning>
  Vui lòng xem lại [các quy tắc quan trọng](/testing/post-verification#mentions) về nhắc tên.
</Warning>

## Giới hạn ký tự

Vui lòng xem [Giới hạn ký tự Telegram](/help-center/technical-support/character_limits#telegram-character-limits) để biết thêm thông tin.
