Telegram Bot API
🌐 Türkçe

sendContact

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

Kişi gönderir.

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

Parametreler

ParametreTürZorunluAçıklama
business_connection_idStringİsteğe bağlıİşletme bağlantısı ID'si
chat_idInteger or StringEvetSohbet ID'si veya @username
message_thread_idIntegerİsteğe bağlıForum konusu ID'si
direct_messages_topic_idIntegerİsteğe bağlıDoğrudan mesajlar konusu ID'si (Bot API 10.0)
ephemeral_message_parametersEphemeralMessageParametersİsteğe bağlıJSON EphemeralMessageParameters nesnesi — yalnızca tek bir kullanıcıya görünen geçici mesaj (Bot API 10.3)
phone_numberStringEvetTelefon numarası
first_nameStringEvetKişinin adı
last_nameStringİsteğe bağlıSoyadı
vcardStringİsteğe bağlıvCard kişi verisi
disable_notificationBooleanİsteğe bağlıSessiz gönder
protect_contentBooleanİsteğe bağlıİçeriği koru
allow_paid_broadcastBooleanİsteğe bağlıÜcretli yayına izin ver
message_effect_idStringİsteğe bağlıMesaj efekti ID'si
suggested_post_parametersSuggestedPostParametersİsteğe bağlıJSON SuggestedPostParameters nesnesi (kanallar için)
reply_parametersReplyParametersİsteğe bağlıJSON ReplyParameters nesnesi
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyİsteğe bağlıJSON: InlineKeyboardMarkup / ReplyKeyboardMarkup / ReplyKeyboardRemove / ForceReply

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/sendContact" \
  -H "Content-Type: application/json" \
  -d '{
  "chat_id": 123456789,
  "phone_number": "+15551234567",
  "first_name": "Alice"
}'

Python

import requests

TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.post(
    f"https://api.telegram.org/bot{TOKEN}/sendContact",
    json={
        "chat_id": 123456789,
        "phone_number": "+15551234567",
        "first_name": "Alice"
    },
    timeout=30,
)
print(resp.json())

JavaScript

const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/sendContact`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "chat_id": 123456789,
    "phone_number": "+15551234567",
    "first_name": "Alice"
  }),
});
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