Main

Receiving Messages & WhatsApp Webhooks | Ngrok | How to test your bot locally

Useful links for this video: How to get started with our WhatsApp API: https://support.whapi.cloud/help-desk/getting-started/getting-started NodeJS bot source code from this video: https://github.com/Whapi-Cloud/nodejs-whatsapp-chatbot Detailed article about working with webhooks in WhatsApp API: https://support.whapi.cloud/help-desk/guides/webhooks-for-whatsapp-api Features of our Cloud API: https://whapi.cloud/features **************** Your WhatsApp bot and API gateway should communicate with each other so that when something changes on one system, the other system knows about it. For example, tracking changes in the status of messages such as 'sent', 'delivered' and 'read'. A specially configured webhook allows your server to be instantly aware of certain events. Depending on your settings, you can receive notifications about messages, their status, channel status and even missed calls. Whapi.Cloud provides the ability to customize a webhook for your bot. And you can customize several webhooks at once for different events and with different conditions. In this video, we will show how to run ngrok and demonstrate the key principles of testing your bot for WhatsApp locally. When developing your bot for WhatsApp, you'll want to test it locally before deploying it to the server. The easiest way to do this is to use tools like ngrok, which creates a secure tunnel to your localhost, allowing you to grant access to your local server from the Internet. 1. Download ngrok and unzip it. https://ngrok.com/ 2. Open your terminal and navigate to the folder where ngrok is stored. 3. Run ./ngrok http PORT_NUMBER, replacing PORT_NUMBER with the port where your Express server is running locally. 4. Now you should have a public URL that you can use as a webhook URL in your Whapi.Cloud dashboard.

Whapi Cloud API

3 weeks ago

today I would like to show by example our WhatsApp bot on node.js how to install a web hook for the bot to work and how to use gork to test the bot locally so as a basis we took the source code which is available on our GitHub to work you will need a connected number to our service how to connect the number read in the description copy the channel token paste it into the config file Run gork download link in the description call the command specifying the port and get the highlighted URL copy it
and also paste the link into config attention for the work of our source bot the link must remain the full path with the element SL hook run the bot it independently puts the specified web hook in the settings of your channel and check the work of the bot hooray the bot responds let's see what came to the web hook the incoming data will be in Jon format this is the full details of the incoming message with the number of the user and their message this way you can react to incoming commands in a
ny way you want to improve the bot subscribe watch our other videos and if you have any questions contact us and support we will help you

Comments