Telegram Bot API
🌐 Tiếng Việt

editStory

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

Chỉnh sửa story thay mặt tài khoản doanh nghiệp.

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
story_idIntegerCóID story
contentInputStoryContentCóĐối tượng JSON InputStoryContent
captionStringTùy chọnChú thích mới
parse_modeStringTùy chọnHTML, Markdown, MarkdownV2
caption_entitiesArray of MessageEntityTùy chọnMảng JSON MessageEntity
areasArray of StoryAreaTùy chọnMảng JSON StoryArea

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/editStory" \
  -H "Content-Type: application/json" \
  -d '{
  "business_connection_id": "BUSINESS_CONNECTION_ID",
  "story_id": 1,
  "content": {
    "type": "photo",
    "photo": "attach://photo"
  }
}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/editStory",
    json={
        "business_connection_id": "BUSINESS_CONNECTION_ID",
        "story_id": 1,
        "content": {
            "type": "photo",
            "photo": "attach://photo"
        }
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/editStory`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "business_connection_id": "BUSINESS_CONNECTION_ID",
    "story_id": 1,
    "content": {
      "type": "photo",
      "photo": "attach://photo"
    }
  }),
});
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