Telegram Bot API
🌐 한국어

editStory

카테고리: 스토리 · Bot API 10.3 · 공식 문서

비즈니스 계정을 대신하여 스토리를 수정합니다.

반환값: 성공 시 반환값: Story.

매개변수

매개변수타입필수설명
business_connection_idString예비즈니스 연결 ID
story_idInteger예스토리 ID
contentInputStoryContent예InputStoryContent JSON 객체
captionString선택새 캡션
parse_modeString선택HTML, Markdown, MarkdownV2
caption_entitiesArray of MessageEntity선택MessageEntity JSON 배열
areasArray of StoryArea선택StoryArea JSON 배열

매개변수 설명은 핵심만 간추린 요약입니다. 전체 설명은 공식 문서에서 확인할 수 있습니다.

요청 예제

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());

단계별 가이드: 텔레그램 봇 만들기: @BotFather로 생성하고 첫 메시지 보내기