Share

Web kancaları, platformumuzun en kullanışlı özelliklerinden biridir. Geliştiricilerin ve site sahiplerinin, otomatik görevler oluşturmak için yararlı olan cihazlardan veya WhatsApp sunucusundan olayları dinlemesine olanak tanır. Bu işlev, yalnızca sms, WhatsApp sohbeti, ussd yanıtı ve android bildirimleri gibi olayları almak için özel olarak tasarlanmıştır.

Posted At: Şub 10, 2023 - 1,337 Views

Kullanım Örnekleri

  • SMS ve WhatsApp için bir otomatik yanıt botu oluşturun.
  • Mesajları ve sohbetleri aldığınızda kendi veritabanınıza kaydedin.
  • Bildirimleri aldığınızda kendi veritabanınıza kaydedin.
  • USSD yanıtlarını aldığınızda kendi veritabanınıza kaydedin.
  • Yükü belirtilen e-posta adreslerine gönderin.
  • Facebook'tan bir bildirim aldığınızda SMS/Sohbet gönderin.
  • Bir uygulamadan bildirim aldığınızda bir şeyler yapın.

Nasıl Çalışır?

Sistem her iki kaynaktan da alınan bir olay alır, ardından web kancası url'si çağrılır ve yük verileri gönderilir. Webhook sunucunuz bunu aldığında, yükle ilgili her şeyi kendiniz yapabilirsiniz. Faydalı yükler, verimli teslimatı sağlamak için POST yöntemi ile gönderilir.


flow
 

Faydalı Yük Yapısı

Yük yapısı basittir; Yalnızca yükün türünü kontrol etmeniz ve ardından veri gövdesinin içeriğini işlemeniz gerekir.

# sms
[
    "type" => "sms", // type of payload: received sms
    "data" => [
        "id" => 2, // unique id from the system
        "rid" => 10593, // unique id from the device
        "sim" => 1, // sim card slot
        "device" => "00000000-0000-0000-d57d-f30cb6a89289", // device unique id
        "phone" => "+639760713666", // sender phone number
        "message" => "Hello World!", // message
        "timestamp" => 1645684231 // receive timestamp
    ]
]
# whatsapp
[
    "type" => "whatsapp", // type of payload: received whatsapp chat
    "data" => [
        "id" => 2, // unique id from the system
        "wid" => "+639760713666", // whatsapp account phone number
        "phone" => "+639760666713", // sender phone number
        "message" => "Hello World!", // message
        "timestamp" => 1645684231 // receive timestamp
    ]
]
# ussd
[
    "type" => "ussd", // type of payload: received ussd response
    "data" => [
        "id" => 98, // unique id from the system
        "sim" => 1, // sim card slot
        "device" => "00000000-0000-0000-d57d-f30cb6a89289", // device unique id
        "code" => "*143#", // ussd code
        "response" => "Sorry! You are not allowed to use this service.", // ussd response
        "timestamp" => 1645684231 // receive timestamp
    ]
]
# notification
[
    "type" => "notification", // type of payload: received notification
    "data" => [
        "id" => 77, // unique id from the system
        "device" => "00000000-0000-0000-d57d-f30cb6a89289", // device unique id
        "package" => "com.facebook.katana", // application package name
        "title" => "Someone commented on your post!", // notification title
        "content" => "Someone commented on your post!", // notification content
        "timestamp" => 1645684231 // receive timestamp
    ]
]

Kod Örneği

 Webhooks)

    /**
     * Validate webhook secret
     */

    if(isset($request["secret"]) && $request["secret"] == $secret):
        // Valid webhook secret
        $payloadType = $request["type"];
        $payloadData = $request["data"];

        // do something with the payload
        print_r($payloadType);
        print_r($payloadData);
    else:
        // Invalid webhook secret
    endif;

APK dosyasını indir

APK dosyasını android telefonunuza indirin ve yükleyin

github download App SmsNotif download App
Virüslere karşı kontrol edildi Apk dosyası hakkında daha fazla bilgi
image-1
image-2