salman0ansari / whatsapp-api-nodejs

RESTful WhatsApp API with Multiple Device Support
GNU General Public License v3.0
1.27k stars 606 forks source link

How to enable Webhook for devices #753

Closed Momaiz closed 1 year ago

Momaiz commented 1 year ago

Hello , How are you

I need to webhook when have answer on any messages we sent . so i add to .env

WEBHOOK_ENABLED=true
WEBHOOK_URL=WEBHOOKURL
WEBHOOK_BASE64=false
WEBHOOK_ALLOWED_EVENTS=messages,presense

and restarted the server to load my .env updates

also in my webhook url i recived all request and posted data and save them to file but no data was sent .

What am i missing ?

Best regards

achdiadsyah commented 1 year ago

i think if you change the config on your env file, it would receive all information from all instance. to do this individually, you can add some parameters to init url like this

http://localhost:3333/instance/init?webhook=true_or_false&webhookUrl=your_webhook_url

also in your env file you must set to WEBHOOK_ENABLED=true

Correct me if i am wrong @salman0ansari

Momaiz commented 1 year ago

Thank you for answer @achdiadsyah We already enabled webhook in .env And when initlizaize instance we sent

webhook=true
webhookUrl=https://momaiz.net/wapi.php

Also we checked the .env file

WEBHOOK_ENABLED=true
WEBHOOK_URL=http://momaiz.net/wapi.php
WEBHOOK_BASE64=true
WEBHOOK_ALLOWED_EVENTS=all

Webhook not fired , @achdiadsyah @salman0ansari how can we test please ?

Momaiz commented 1 year ago

Sorry, it was my fault . the problem was "i added webhool url as http but ssl redirect it to https" so when redirect the data ignored .