Başlarken

WhatsApp Web API, WhatsApp'ı uygulamalarınıza entegre etmenin basit ve güçlü bir yolunu sunar.

Başlamak için iki kimlik bilgilerine ihtiyacınız olacak::
  • Erişim Jetonu: API isteklerini doğrulamak için kullanılan güvenli bir anahtar.
  • WhatsApp Örnek Kimliği: WhatsApp hesap oturumunuza bağlı benzersiz bir tanımlayıcı.

Henüz kimlik bilgileriniz yok mu? Buradan abone olun Erişim Simgenizi ve Örnek Kimliğinizi almak için.

Temel yollar:
https://wonotify.com/api/...
https://wonotify.com/whatsapp_api/...
Her iki temel yol da desteklenir ve aynı yanıtı döndürür.

Örnekler

Örnek Oluştur
POST

WhatsApp Web'e bağlanmak için yeni bir Örnek Kimliği oluşturun.

API uç noktası:
https://wonotify.com/api/create_instance?access_token=6881c11f741a1
Parametreler:
ParameterTypeRequiredDescription
access_tokenstringYesYour API access token
Örnek:
curl -X POST 'https://wonotify.com/api/create_instance?access_token=6881c11f741a1'
Örneği Yeniden Başlat
POST

WhatsApp web'den çıkış yapın ve yeni bir tarama yapın.

API uç noktası:
https://wonotify.com/api/reboot?instance_id=609ACF283XXXX&access_token=6881c11f741a1
Parametreler:
ParameterTypeRequiredDescription
instance_idstringYesWhatsApp instance ID
access_tokenstringYesYour API access token
Örneği Sıfırla
POST

Bu, WhatsApp web'den çıkış yapacak, Örnek Kimliğini değiştirecek ve tüm eski örnek verilerini silecektir.

API uç noktası:
https://wonotify.com/api/reset_instance?instance_id=609ACF283XXXX&access_token=6881c11f741a1
Yeniden bağlan
POST

Bağlantı kesildiğinde uygulamadan WhatsApp web'e bağlantıyı yeniden başlatın.

API uç noktası:
https://wonotify.com/api/reconnect?instance_id=609ACF283XXXX&access_token=6881c11f741a1
Oturumu Kapatma Örneği
POST

WhatsApp Web örneğinden çıkış yapın.

API uç noktası:
https://wonotify.com/api/logout?instance_id=609ACF283XXXX&access_token=EMCUH3NQQK8YXXXX

WhatsApp Girişi

QR Kodunu Alın
POST

WhatsApp web'e giriş yapmak için QR kodunu görüntüleyin. Döndürülen sonuçları Webhook aracılığıyla alabilirsiniz.

API uç noktası:
https://wonotify.com/api/get_qrcode?instance_id=609ACF283XXXX&access_token=6881c11f741a1
Parametreler:
ParameterTypeRequiredDescription
instance_idstringYesWhatsApp instance ID
access_tokenstringYesYour API access token

Mesajlaşma

Kısa Mesaj Gönder
POST

Uygulama aracılığıyla bir telefon numarasına kısa mesaj gönderin.

Yöntem 1: GET İsteği:
https://wonotify.com/api/send?number=84933313xxx&type=text&message=test+message&instance_id=609ACF283XXXX&access_token=6881c11f741a1
Yöntem 2: POST İsteği:
https://wonotify.com/api/send
POST Gövde Yapısı:
Content-Type: application/json
{
  "number": "84933313xxx",
  "type": "text",
  "message": "test message",
  "instance_id": "609ACF283XXXX",
  "access_token": "6881c11f741a1"
}
Parametreler:
ParameterTypeRequiredDescription
numberstringYesPhone number (without +)
typestringYesMessage type: "text"
messagestringYesText message content
instance_idstringYesWhatsApp instance ID
access_tokenstringYesYour API access token
Medya ve Dosyaları Gönder
POST

Uygulama aracılığıyla bir telefon numarasına mesaj içeren bir medya veya dosya gönderin.

Yöntem 1: GET İsteği:
https://wonotify.com/api/send?number=84933313xxx&type=media&message=test+message&media_url=https%3A%2F%2Fi.pravatar.cc&filename=file_test.jpg&instance_id=609ACF283XXXX&access_token=6881c11f741a1
Yöntem 2: POST İsteği:
https://wonotify.com/api/send
POST Gövde Yapısı:
Content-Type: application/json
{
  "number": "84933313xxx",
  "type": "media",
  "message": "test message",
  "media_url": "https://i.pravatar.cc",
  "instance_id": "609ACF283XXXX",
  "access_token": "6881c11f741a1"
}
Parametreler:
ParameterTypeRequiredDescription
numberstringYesPhone number (without +)
typestringYesMessage type: "media"
messagestringYesCaption for the media
media_urlstringYesURL of the media file
filenamestringNoFilename (for documents: file_test.pdf)
instance_idstringYesWhatsApp instance ID
access_tokenstringYesYour API access token
Şablon Düğmesi/Listesi Gönder
POST

Uygulama aracılığıyla bir telefon numarasına Şablon mesajı gönderin.

API uç noktası:
https://wonotify.com/api/send_template?instance_id=609ACF283XXXX&access_token=6881c11f741a1
İnteraktif Mesaj Yapısı (Önerilen):
Content-Type: application/json
{
  "number": "84933313xxx",
  "type": "interactive",
  "message": {
    "text": "This is an Interactive message!",
    "title": "Test Title",
    "subtitle": "subtitle",
    "footer": "test footer",
    "interactiveButtons": [
      {
        "name": "quick_reply",
        "buttonParamsJson": "{\"display_text\":\"Test\",\"id\":\"685250bce39ca\"}"
      },
      {
        "name": "cta_url",
        "buttonParamsJson": "{\"display_text\":\"Click me!\",\"url\":\"https://baceoin.com\"}"
      },
      {
        "name": "cta_call",
        "buttonParamsJson": "{\"display_text\":\"Call Us\",\"phone_number\":\"+1234567890\"}"
      },
      {
        "name": "cta_copy",
        "buttonParamsJson": "{\"display_text\":\"Copy Code\",\"copy_code\":\"PROMO2024\"}"
      }
    ]
  }
}
Eski Şablon Formatı (Kullanımdan Kaldırıldı):
Content-Type: application/json
{
  "number": "84933313xxx",
  "type": "template",
  "message": {
    "text": "This is a template message!",
    "footer": "test footer",
    "templateButtons": [
      {
        "index": 1,
        "quickReplyButton": {
          "displayText": "Test",
          "id": "685250bce39ca"
        }
      }
    ]
  }
}
Mesaj Yapısını Listele:
Content-Type: application/json
{
  "number": "84933313xxx",
  "type": "list",
  "message": {
    "text": "hello",
    "footer": "test footer",
    "title": "test title",
    "buttonText": "bay",
    "sections": [
      {
        "title": "hello",
        "rows": [
          {
            "title": "hello",
            "rowId": "685410595972e",
            "description": "hello"
          }
        ]
      }
    ]
  }
}

Gruplar

Grup Metni Gönder
POST

Bir WhatsApp grubuna kısa mesaj gönderin.

Yöntem 1: GET İsteği:
https://wonotify.com/api/send_group?group_id=120363023285171234@g.us&type=text&message=group+message&instance_id=609ACF283XXXX&access_token=6881c11f741a1
Yöntem 2: POST İsteği:
https://wonotify.com/api/send_group
POST Gövde Yapısı:
Content-Type: application/json
{
  "group_id": "120363023285171234@g.us",
  "type": "text",
  "message": "group message",
  "instance_id": "609ACF283XXXX",
  "access_token": "6881c11f741a1"
}
Parametreler:
ParameterTypeRequiredDescription
group_idstringYesWhatsApp group ID (ends with @g.us)
typestringYesMessage type: "text"
messagestringYesText message content
instance_idstringYesWhatsApp instance ID
access_tokenstringYesYour API access token
Grup Medyasını Gönder
POST

Medya veya dosyaları altyazılı olarak bir WhatsApp grubuna gönderin.

Yöntem 1: GET İsteği:
https://wonotify.com/api/send_group?group_id=120363023285171234@g.us&type=media&message=group+message&media_url=https%3A%2F%2Fi.pravatar.cc&filename=file_test.jpg&instance_id=609ACF283XXXX&access_token=6881c11f741a1
Yöntem 2: POST İsteği:
https://wonotify.com/api/send_group
POST Gövde Yapısı:
Content-Type: application/json
{
  "group_id": "120363023285171234@g.us",
  "type": "media",
  "message": "group message",
  "media_url": "https://i.pravatar.cc",
  "filename": "file_test.jpg",
  "instance_id": "609ACF283XXXX",
  "access_token": "6881c11f741a1"
}
Parametreler:
ParameterTypeRequiredDescription
group_idstringYesWhatsApp group ID (ends with @g.us)
typestringYesMessage type: "media"
messagestringYesCaption for the media
media_urlstringYesURL of the media file
filenamestringNoFilename (for documents: file_test.pdf)
instance_idstringYesWhatsApp instance ID
access_tokenstringYesYour API access token

Web kancaları

Alma Web Kancasını Ayarla
POST

WhatsApp'tan tüm dönüş değerlerini alın. Bağlantı durumu, Gelen mesaj, Giden mesaj, Bağlantı Kesildi, Pili Değiştir gibi...

API uç noktası:
https://wonotify.com/api/set_webhook?webhook_url=https%3A%2F%2Fwebhook.site%2F1b25464d6833784f96eef4xxxxxxxxxx&enable=true&instance_id=609ACF283XXXX&access_token=6881c11f741a1
Parametreler:
ParameterTypeRequiredDescription
webhook_urlstringYesYour webhook URL (URL encoded)
enablebooleanYesEnable/disable webhook (true/false)
instance_idstringYesWhatsApp instance ID
access_tokenstringYesYour API access token
Web Kancası Etkinlikleri:
  • message: Yeni gelen mesaj
  • message_status: Mesaj teslim durumu
  • presence: Kullanıcının çevrimiçi/çevrimdışı durumu