• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Webhook Setup for Wa Gateway | Multi device BETA | V3.0 MPWA MD

starkids

Active member
Sep 21, 2020
169
66
28
This thread is a discussion about webhook integration, rest api or plugins for Wa Gateway | Multi-device BETA | V3.0 MPWA MD.

integration to wordpress,
- woocommerce
- Form (gravityform, caldera, etc.)
- Uncanny automator

Integration with other programs
You can share information about webhook and rest api in here..


You can access the discussion about the Wa Gateway Program at the link:
 
How to integrate MPWA with Gravity Form

1. Download Gravity WebHook https://babia.to/resources/gravity-forms-webhooks-add-on.4854/
(Download - Upload - And Activated)
2. Go to the form - setting - webhook
3. Follow this seting
1652889129818.png 1652889202905.png
Request URL(Required) : http://yourdomain.com/send-message
Request Method(Required) : POST
Request Format(Required) : JSON

Request Body :
api_key = YOUR_API_KEY
sender = NUMBER_ON_MPWA
number = NUMBER_RECIVER_GET_FROM_FORM
message = GET_FROM_FORM

You can customize message with merge tag,

and make sure there is no whatsapp gateway plugin for gravity forms from other platforms, because it can make the Rest API not run normally.

Thanks for @Morehere
 
need an example of php webhook, i have try sccript from rest api>>webhook it doesnt work, nothing respon while i try to access php file
yes if someone can share just plain php script to access MPWA webhook request
thx
 
I didn't get you.
Oh, i get it, after see this code :

Code:
<?php


header('content-type: application/json');
$data = json_decode(file_get_contents('php://input'), true);
file_put_contents('whatsapp.txt', '[' . date('Y-m-d H:i:s') . "]\n" . json_encode($data) . "\n\n", FILE_APPEND);                                              
$message = strt¸olower($data['message']);
$from = strt¸olower($data['from']);
$respon = false;

// auto respond text  
function sayHello(){  
return ["text" => 'Halloooo!'];
             }
?>

but i have question, webhook code on documentation mpwa menu, i must save it on listen.php or whatsapp.txt ?
 
Oh, i get it, after see this code :

Code:
<?php


header('content-type: application/json');
$data = json_decode(file_get_contents('php://input'), true);
file_put_contents('whatsapp.txt', '[' . date('Y-m-d H:i:s') . "]\n" . json_encode($data) . "\n\n", FILE_APPEND);                                             
$message = strt¸olower($data['message']);
$from = strt¸olower($data['from']);
$respon = false;

// auto respond text 
function sayHello(){ 
return ["text" => 'Halloooo!'];
             }
?>

but i have question, webhook code on documentation mpwa menu, i must save it on listen.php or whatsapp.txt ?
it should be listen.php, i try installing on my shared hosting and webhook doesnt work properly. i just try webhook with webhook test and sending some messages and the result is nothing, i dont know about localhost and vps maybe thats working or has same problem
 
it should be listen.php, i try installing on my shared hosting and webhook doesnt work properly. i just try webhook with webhook test and sending some messages and the result is nothing, i dont know about localhost and vps maybe thats working or has same problem
would you like to share the script? so we can try in our hosting
 
it should be listen.php, i try installing on my shared hosting and webhook doesnt work properly. i just try webhook with webhook test and sending some messages and the result is nothing, i dont know about localhost and vps maybe thats working or has same problem
would you like to share the script? so we can try in our hosting

Follow the step it is working normally on localhost and VPS. (For shared hosting auto reply works sometime and stops after 1 minute after reloading scan page and restarting nodeJS)

1. Create "listen.php" then copy paste code from Rest Api-> webhook.
2. Add webhook link as "http://yourwebsite.com/listen.php" in link field as shown in screenshot below
1653016752850.png
3. Create "whatsapp.txt" in the same location of "listen.php" file and give permission as 777.
4. Restart NodeJs and now send keywords that are in the "listen.php".
 
  • Like
Reactions: JohnSakala
Follow the step it is working normally on localhost and VPS. (For shared hosting auto reply works sometime and stops after 1 minute after reloading scan page and restarting nodeJS)

1. Create "listen.php" then copy paste code from Rest Api-> webhook.
2. Add webhook link as "http://yourwebsite.com/listen.php" in link field as shown in screenshot below
1653016752850.png
3. Create "whatsapp.txt" in the same location of "listen.php" file and give permission as 777.
4. Restart NodeJs and now send keywords that are in the "listen.php".
i try installed on my vps (aapanel not directly install on my vps), autoreply not working in my case i use wabeta.m-pedia.id:10000 as my node server which is from demo page hehehe coz my nodejs from the vps not working properly
 
i try installed on my vps (aapanel not directly install on my vps), autoreply not working in my case i use wabeta.m-pedia.id:10000 as my node server which is from demo page hehehe coz my nodejs from the vps not working properly
Use your own applications and try. If it is not working then raise issue here.
 
I did not understand yet what is the function of webhook inside the code and when I add it inside the script what is its use
 
Follow the step it is working normally on localhost and VPS. (For shared hosting auto reply works sometime and stops after 1 minute after reloading scan page and restarting nodeJS)

1. Create "listen.php" then copy paste code from Rest Api-> webhook.
2. Add webhook link as "http://yourwebsite.com/listen.php" in link field as shown in screenshot below
1653016752850.png
3. Create "whatsapp.txt" in the same location of "listen.php" file and give permission as 777.
4. Restart NodeJs and now send keywords that are in the "listen.php".
oh ok i got it,
Next question, where do I write the response code?
eg: hello => response hi
 
oh ok i got it,
Next question, where do I write the response code?
eg: hello => response hi
Please go through the code where you will find keyword as "hai" and response as "Halloooo!".
You can create your own keywords and response as well.
 
  • Like
Reactions: starkids
I did not understand yet what is the function of webhook inside the code and when I add it inside the script what is its use
It depends on type of response you want to send when keywords has been requested.

Here type of response is usefull when you want to fetch data from multiple database (Databases are from other websites).
 
It depends on type of response you want to send when keywords has been requested.

Here type of response is usefull when you want to fetch data from multiple database (Databases are from other websites).
I alrady put webhook in mydomain.com/webhook.php
1653030436889.png
*why line number 7 & 8 become like that ? i just copy from rest api --> webhook menu

file whatsapp.txt also get updated
1653029998269.png

but everytime write "hai" I didn't get any reply...
- i already restart the nodejs
 

Attachments

  • 1653029950719.png
    1653029950719.png
    39.1 KB · Views: 65
  • 1653030416891.png
    1653030416891.png
    45.4 KB · Views: 61
Last edited:
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock