Telegram Bot API
🌐 Türkçe

repostStory

Kategori: Hikayeler · Bot API 10.3 · Resmi dokümantasyon

Hikayeyi işletme hesapları arasında yeniden paylaşır (Bot API 9.3).

Dönüş değeri: Başarılı olduğunda Story döndürür.

Parametreler

ParametreTürZorunluAçıklama
business_connection_idStringEvetİşletme bağlantısı ID'si
from_chat_idIntegerEvetHikayeyi paylaşan sohbetin ID'si
from_story_idIntegerEvetYeniden paylaşılacak hikayenin ID'si
active_periodIntegerEvetAktif kalma süresi (saniye): 21600, 43200, 86400 veya 172800
post_to_chat_pageBooleanİsteğe bağlıSüresi dolduktan sonra hikayeyi erişilebilir tut
protect_contentBooleanİsteğe bağlıİçeriği iletme ve ekran görüntüsü almaya karşı koru

Parametre açıklamaları kısa özetlerdir; tam metin için resmi dokümantasyona bakın.

Örnek istek

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

Adım adım rehber: Telegram bot nasıl yapılır? BotFather ile adım adım bot oluşturma