Telegram Bot API
🌐 한국어

repostStory

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

비즈니스 계정 간에 스토리를 리포스트합니다 (Bot API 9.3).

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

매개변수

매개변수타입필수설명
business_connection_idString예비즈니스 연결 ID
from_chat_idInteger예스토리를 게시한 채팅 ID
from_story_idInteger예리포스트할 스토리 ID
active_periodInteger예활성 기간(초): 21600, 43200, 86400 또는 172800
post_to_chat_pageBoolean선택만료 후에도 스토리를 볼 수 있게 유지
protect_contentBoolean선택전달 및 스크린샷으로부터 콘텐츠 보호

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

요청 예제

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

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