sendVideo
Video gönderir.
Dönüş değeri: Başarılı olduğunda Message döndürür.
Parametreler
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
business_connection_id | String | İsteğe bağlı | İşletme bağlantısı ID'si |
chat_id | Integer or String | Evet | Sohbet ID'si veya @username |
message_thread_id | Integer | İsteğe bağlı | Forum konusu ID'si |
direct_messages_topic_id | Integer | İsteğe bağlı | Doğrudan mesajlar konusu ID'si (Bot API 10.0) |
ephemeral_message_parameters | EphemeralMessageParameters | İsteğe bağlı | JSON EphemeralMessageParameters nesnesi — yalnızca tek bir kullanıcıya görünen geçici mesaj (Bot API 10.3) |
video | InputFile or String | Evet | Video URL'si veya file_id |
duration | Integer | İsteğe bağlı | Süre (saniye) |
width | Integer | İsteğe bağlı | Video genişliği |
height | Integer | İsteğe bağlı | Video yüksekliği |
thumbnail | InputFile or String | İsteğe bağlı | Küçük resim URL'si veya file_id |
cover | InputFile or String | İsteğe bağlı | Video kapağı (Bot API 10.0) |
start_timestamp | Integer | İsteğe bağlı | Video başlangıç zaman damgası (Bot API 10.0) |
caption | String | İsteğe bağlı | Altyazı (0-1024) |
parse_mode | String | İsteğe bağlı | HTML, Markdown, MarkdownV2 |
caption_entities | Array of MessageEntity | İsteğe bağlı | JSON MessageEntity dizisi |
show_caption_above_media | Boolean | İsteğe bağlı | Altyazıyı videonun üstünde göster |
has_spoiler | Boolean | İsteğe bağlı | İçeriği gizle (spoiler) |
supports_streaming | Boolean | İsteğe bağlı | Akış desteği |
disable_notification | Boolean | İsteğe bağlı | Sessiz gönder |
protect_content | Boolean | İsteğe bağlı | İçeriği koru |
allow_paid_broadcast | Boolean | İsteğe bağlı | Ücretli yayına izin ver |
message_effect_id | String | İsteğe bağlı | Mesaj efekti ID'si |
suggested_post_parameters | SuggestedPostParameters | İsteğe bağlı | JSON SuggestedPostParameters nesnesi |
reply_parameters | ReplyParameters | İsteğe bağlı | JSON ReplyParameters nesnesi |
reply_markup | InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply | İsteğe bağlı | JSON: InlineKeyboardMarkup / ReplyKeyboardMarkup / ReplyKeyboardRemove / ForceReply |
Örnek istek
curl
curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendVideo" \
-H "Content-Type: application/json" \
-d '{"chat_id":123456789,"video":"https://example.com/video.mp4"}'
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
f"https://api.telegram.org/bot{TOKEN}/sendVideo",
json={
"chat_id": 123456789,
"video": "https://example.com/video.mp4"
},
timeout=30,
)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/sendVideo`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"video": "https://example.com/video.mp4"
}),
});
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
İlgili metotlar
sendPhotoFotoğraf gönderir.sendDocumentBelge gönderir.sendAudioSes dosyası gönderir.sendAnimationAnimasyon (GIF) gönderir.sendStickerÇıkartma gönderir.sendVoiceSesli mesaj gönderir.sendVideoNoteGörüntülü mesaj (yuvarlak video) gönderir.sendMediaGroupMedya grubu (albüm) gönderir.sendPaidMediaÜcretli medya gönderir (Bot API 8.0+).sendDiceZar gönderir.sendLivePhotoCanlı fotoğraf gönderir (fotoğraf + video, Bot API 10.0).