Share

वेपहुक हमारे मंच की सबसे उपयोगी विशेषताओं में से एक हैं। यह डेवलपर्स और साइट मालिकों को डिवाइस या व्हाट्सएप सर्वर से घटनाओं को सुनने की अनुमति देता है, जो स्वचालित कार्य बनाने के लिए उपयोगी है। यह फ़ंक्शन विशेष रूप से केवल ईवेंट प्राप्त करने के लिए डिज़ाइन किया गया है, जैसे एसएमएस, व्हाट्सएप चैट, यूएसएसडी प्रतिक्रिया और एंड्रॉइड सूचनाएं।

Posted At: फ़र. 10, 2023 - 1,341 Views

मामलों का उपयोग करें

  • एसएमएस और व्हाट्सएप के लिए एक ऑटोरिप्लाई बॉट बनाएं।
  • प्राप्त करने पर अपने स्वयं के डेटाबेस में संदेश और चैट सहेजें।
  • प्राप्त करने पर सूचनाओं को अपने स्वयं के डेटाबेस में सहेजें।
  • प्राप्त करने पर अपने स्वयं के डेटाबेस में यूएसएसडी प्रतिक्रियाओं को सहेजें।
  • पेलोड निर्दिष्ट ईमेल पते पर भेजें।
  • फेसबुक से नोटिफिकेशन मिलने पर एसएमएस/चैट भेजें।
  • जब आपको किसी ऐप से नोटिफिकेशन मिले तो कुछ करें।

यह कैसे काम करता है

सिस्टम को दोनों स्रोतों से एक प्राप्त घटना मिलती है, फिर वेहुक यूआरएल को लागू किया जाएगा और पेलोड डेटा भेजा जाएगा। जब आपका वेबहुक सर्वर इसे प्राप्त करता है, तो आप पेलोड के साथ कुछ भी कर सकते हैं। कुशल वितरण सुनिश्चित करने के लिए पेलोड को पोस्ट विधि के साथ भेजा जाता है।


flow
 

पेलोड संरचना

पेलोड संरचना सीधी है; आपको बस पेलोड के प्रकार की जांच करने और फिर डेटा बॉडी की सामग्री को संसाधित करने की आवश्यकता है।

# 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
    ]
]
# अधिसूचना
[
    "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
    ]
]

कोड उदाहरण

 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 फ़ाइल डाउनलोड करें

डाउनलोड करें और अपने Android फोन पर APK फ़ाइल स्थापित करें

github download App SmsNotif download App
वायरस के लिए जाँच की गई APK फ़ाइल के बारे में अधिक
image-1
image-2