Telegram Bot API
🌐 Tiếng Việt

repostStory

Danh mục: Story · Bot API 10.3 · Tài liệu chính thức

Đăng lại story giữa các tài khoản doanh nghiệp (Bot API 9.3).

Giá trị trả về: Nếu thành công, trả về Story.

Tham số

Tham sốKiểuBắt buộcMô tả
business_connection_idStringCóID kết nối doanh nghiệp
from_chat_idIntegerCóID của chat đã đăng story
from_story_idIntegerCóID của story cần đăng lại
active_periodIntegerCóThời gian hiển thị tính bằng giây: 21600, 43200, 86400 hoặc 172800
post_to_chat_pageBooleanTùy chọnGiữ story có thể truy cập sau khi hết hạn
protect_contentBooleanTùy chọnBảo vệ nội dung khỏi chuyển tiếp và chụp màn hình

Mô tả tham số chỉ là bản tóm tắt ngắn gọn; xem tài liệu chính thức để đọc toàn văn.

Ví dụ request

curl

curl -s -X POST "https://api.telegram.org/bot$TOKEN/repostStory" \
  -H "Content-Type: application/json" \
  -d '{
  "business_connection_id": "BUSINESS_CONNECTION_ID",
  "from_chat_id": 123456789,
  "from_story_id": 1,
  "active_period": 86400
}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/repostStory",
    json={
        "business_connection_id": "BUSINESS_CONNECTION_ID",
        "from_chat_id": 123456789,
        "from_story_id": 1,
        "active_period": 86400
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/repostStory`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "business_connection_id": "BUSINESS_CONNECTION_ID",
    "from_chat_id": 123456789,
    "from_story_id": 1,
    "active_period": 86400
  }),
});
console.log(await res.json());

Hướng dẫn từng bước: Cách tạo bot Telegram từ A đến Z: BotFather, token và tin nhắn đầu tiên