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

member

Active member
Trusted Uploader
Feb 21, 2019
93
103
33
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
replace line code 7 and 8

Code:
$message = strtolower($data['message']);
$from = strtolower($data['from']);
 

bug7sec

Active member
Babiato Lover
Dec 18, 2020
113
151
43
localhost
1653145274200.png
already create whatsapp.txt then permission 777
this my webhook.php
PHP:
<?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 = strtolower($data['message']);
$from = strtolower($data['from']);
 $respon = true;
 
 // auto respond text   
 function sayHello(){   
 return ["text" => 'Halloooo!'];
             }
 
 // auto respond gambaar           
function gambar(){
 return [
     'image' => ['url' => 'https://seeklogo.com/images/W/whatsapp-logo-A5A7F17DC1-seeklogo.com.png'],
     'caption' => 'Logo whatsapp!'
 ];   
}
 
//auto respond button
 function button(){
     $buttons = [
         ['buttonId' => 'id1', 'buttonText' => ['displayText' => 'BUTTON 1'], 'type' => 1], // button 1 //
         ['buttonId' => 'id2', 'buttonText' => ['displayText' => 'BUTTON 2'], 'type' => 1], // button 2
         ['buttonId' => 'id3', 'buttonText' => ['displayText' => 'BUTTON 3'], 'type' => 1], // button 3
     ];
     $buttonMessage = [
         'text' => 'HOLA, INI ADALAH PESAN BUTTON',
         'footer' => 'ini pesan footer',
         'buttons' => $buttons,
         'headerType' => 1
     ];
     return $buttonMessage;
 }
 
 // auto respon lists
function lists(){
 $sections = [
        [
            "title" => "This is List menu",
            "rows" => [
            ["title" => "List 1", "description" => "this is list one"],
            ["title" => "List 2", "description" => "this is list two"],
        ]
    ]
];
 
 $listMessage = [
  "text" => "This is a list",
  "title" => "Title Chat",
  "buttonText" => "Select what will you do?",
  "sections" => $sections
 ];
 
 return $listMessage; 
 }
 
 
 if($message === 'hai'){
     $respon = sayHello();
 } else if($message === 'gambar'){
     $respon = gambar();
 } else if($message === 'tes button'){
     $respon = button();
 } else if($message === 'lists msg'){
     $respon = lists();
 }
 echo json_encode($respon);
?>

1653145641147.png
already set in webhook in dashboard
already restart node.
already try rescan number,
i try other autoreply work
i try said hai from webhook, i refresh file manager then check whatsapp.txt but not rewrite
anyone have other solution ?
thanks before
 

Morehere

Well-known member
Null Master
Trusted Uploader
Jan 13, 2020
965
959
93
1653145274200.png
already create whatsapp.txt then permission 777
this my webhook.php



1653145641147.png
already set in webhook in dashboard
already restart node.
already try rescan number,
i try other autoreply work
i try said hai from webhook, i refresh file manager then check whatsapp.txt but not rewrite
anyone have other solution ?
thanks before
Are you trying it on shared hosting?
Is autoreply working?
 

Morehere

Well-known member
Null Master
Trusted Uploader
Jan 13, 2020
965
959
93
1653146726115.png 1653146743270.png
yes bro work autoreply
but not work autoreply from webhook
If autoreply working then webhook should work.

Can you share how to make autoreply to work on shared hosting?
 

bug7sec

Active member
Babiato Lover
Dec 18, 2020
113
151
43
localhost
If autoreply working then webhook should work.

Can you share how to make autoreply to work on shared hosting?
1653148803033.png
I didn't make any changes to get autoreply to work.
i just set Server Type shared : Hosting Shared then port node js : 3200
maybe mistake from provider hosting if ur autoreply not work.
because my autoreply not work on provider hosting before, than i build to other provider hosting my autoreply work..but webhook not work
 

Morehere

Well-known member
Null Master
Trusted Uploader
Jan 13, 2020
965
959
93
1653148803033.png
I didn't make any changes to get autoreply to work.
i just set Server Type shared : Hosting Shared then port node js : 3200
maybe mistake from provider hosting if ur autoreply not work.
because my autoreply not work on provider hosting before, than i build to other provider hosting my autoreply work..but webhook not work
Try webhook link without https:// use http:// instead.
 

bug7sec

Active member
Babiato Lover
Dec 18, 2020
113
151
43
localhost
how to add 2 response or more response in webhook ?
1653169528034.png
i try said 'hai' but just response 'gambar', not response 'sayHello and gambar'..
 

banaaf

Member
May 10, 2021
109
15
18

Hello friends I have practiced all the advice concerning the Webhook until now the auto reply does not work I am a Mutualized VIP host at planethoster.com Ps: the rest works well except the auto reply

Please a good samaritan to help me thank you in advance

 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu