Help Desk
  • Getting Started
    • ๐Ÿ™ŒWelcome to Whapi.Cloud
    • ๐Ÿ’ฐPricing
    • โ˜•Partners
    • ๐Ÿš€Getting started
    • ๐Ÿ‘จโ€๐Ÿ’ปAPI Docs
      • Developer hubs
      • Swagger environment
      • Postman collection
  • Sending
    • Introduction
    • Send text message
      • Whatsapp API send message PHP
      • Whatsapp API send message Python
      • Whatsapp API send message Node JS
      • Whatsapp API send message ะก#
      • Whatsapp API send message Java
      • API integration with VB6
      • Whatsapp API send message GO (Golang)
    • Send video, audio, image, document
      • How to send file from your local computer using the API
    • Send Group message
    • Send post to WhatsApp Channel
    • Send message with Buttons
    • Send Emoji
    • Overview of other methods for sending
      • Send Voice message
      • Send contact (vCard)
      • Send message reactions
  • Receiving
    • Introduction
    • Webhooks
      • Our webhooks (Tracked events)
      • Where to Find the Webhook URL?
      • Set the webhook link to the channel
      • Detailed webhook settings
      • How to check the webhook?
      • Incoming webhooks format
        • Incoming message
        • Sent message
        • Chats
          • How to Track Chat Labels via Webhook
        • Groups
        • Communities
        • Contacts
        • Account and device status
        • Other
          • Calls
          • Presences
          • Labels
          • Views of stories (statuses)
          • Story (status) from your contacts
      • Receive messages
        • Receive WhatsApp messages using PHP
        • Receive WhatsApp messages using Node js
        • Receive WhatsApp messages using Python
    • HTTP API
      • How to retrieve files
      • Retrieve a Specific User's Chat History
      • Get a full-size picture in the response
      • Get order items
      • Get a profile picture of a chat or user
    • File expiration period
  • Groups
    • Send Group message
      • Mentioning all participants in a WhatsApp group
    • Get list of group members
    • Add new member to Group
  • Channels
    • Send post to WhatsApp Channel
    • Get messages from Channels
    • Get votes from polls in the Channel
  • Communities
    • Introduction
    • Create a community
    • Add a member to a community
    • Send announcement
    • Get info on community participants
    • Add a group / Exclude a group from the community
  • Account
    • Setting "Auto Download"
    • Customizable Webhook Headers
    • How to find out the IP channel
    • How to Delete a Channel
    • Add Business Info to Invoice
  • Source code
    • WhatsApp ChatBot
      • WhatsApp Python Bot
      • WhatsApp PHP Bot
      • WhatsApp Node JS Bot
      • WhatsApp Java Bot
    • WhatsApp API Google Sheets
    • WhatsApp Phone Number Checker
    • Request Distributor (Balancer)
  • FAQ
    • Does WhatsApp API work with the phone turned off?
    • Chat ID. What is it and how to get it?
    • Why do I see status "pending" after sending message?
    • How to send a paragraph (line break)
    • Inactive Links in WhatsApp Messages
    • WhatsApp Text Formatting
    • Checking if the number has Whatsapp
    • Specifics of sending messages to numbers of different countries
    • Current status of Buttons on WhatsApp
    • Why aren't participants being added to the group?
  • Hints
    • Android Emulators
    • Virtual Numbers for WhatsApp
    • How to use polls as buttons?
    • How to check who blocked you in Whatsapp?
    • Setting up a WhatsApp proxy
  • Integrations
    • Make.com
      • Ready-Made Scenarios
        • WhatsApp & Whisper API: Voice-to-Text Integration
        • Automated WhatsApp Group Message Forwarding in Make.com
      • Request Scenario Setup
    • Pabbly Connect
    • Google Contacts
    • DialogFlow
    • n8n
  • Tools
    • WhatsApp Number Checker
    • Automatic warm-up module
    • WhatsApp Activity Safety Meter
    • Residential Proxies from Whapi.Cloud
  • Troubleshooting
    • Couldn't Link Device โ€“ WhatsApp QR Code or Pairing Code Fails
    • Channel status โ€œSYNC_ERRORโ€
    • Not getting a READ status on webhook
    • 429 (Too Many Requests) - Soft Ban
    • โ€œWaiting for this message. This may take a whileโ€ โ€“ WhatsApp Message Error
    • Missing push notifications after connecting to API
  • Blocking
    • How to not get Banned?
    • How to do mailings without the risk of being blocked?
    • If My Number Is Banned, Can It Be Restored?
    • Unlocking Your WhatsApp Number
    • Connecting a New WhatsApp Number After a Ban: Steps and Recommendations
    • Warming Up New Phone Numbers for WhatsApp API
  • Partner Documentation
    • Introduction
    • Partner Dashboard Overview
    • Partner Program Guidelines
      • Workflow: Step-by-Step
      • Billing for Partners
      • Allocating Days to Customer Channels: Best Practices & Guide
      • Interface for channel management
    • Partner Documentation
      • Channel creation
      • Changing channel mode
      • Channel extension
      • Channel deletion
      • Getting the list of channels
      • Notices of end of days on balance
Powered by GitBook
On this page
  • How to test Webhook functionality?
  • How to test Webhook locally?
  • Alternatives for local tunneling
  • How do I check if callbacks are being sent from a channel?
  • Troubleshooting
  • 404 Not Found
  • 405 Method Not Allowed
  • 500 Internal Server Error
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 525 SSL Handshake Failed

Was this helpful?

  1. Receiving
  2. Webhooks

How to check the webhook?

Test your webhook on the server and locally

PreviousDetailed webhook settingsNextIncoming webhooks format

Last updated 7 months ago

Was this helpful?

In order to receive incoming webhooks, a public IP address / host is required to be accessible from the Internet. This way the Whapi.Cloud server will be able to make a call to your server at the specified address and deliver the incoming webhook.

Server configuration

Your endpoint needs to accept a POST/PUT/PATCH/DELETE;

The Troubleshooting section will help you to understand frequently occurring errors.

How to test Webhook functionality?

To check and test Webhook and make sure that the server is sending data, we offer you the easiest and fastest option - Webhook simulation.

You can use our solution for this:

We will provide you with a free unique URL that will allow you to test and debug your HTTP requests.


A similar solution could be similar third-party services like webhook.site:

  1. You get a unique link;

  2. Paste it in the channel settings;

  3. See how notifications are caught, what format they are in. This will help to process them in the script.

How to test Webhook locally?

When developing a WhatsApp bot, you might want to test it locally before deploying it to a server.

The simplest way to do this is to use tools like Ngrok, which creates a secure tunnel to your localhost, allowing you to provide access to your local server from the internet.

Alternatives for local tunneling

Here are some good alternatives to Ngrok for tunneling callbacks to your local machine:


How do I check if callbacks are being sent from a channel?

Especially for this purpose, we offer you a special endpoint that allows you to simulate any callback on any event. Thus, you can check if your link is available for our API, as well as see the format of the callback itself.


Troubleshooting

404 Not Found

Cause: The requested resource or endpoint does not exist on the server.

Solution:

  • Verify the URL and ensure it is correctly spelled and corresponds to the correct API endpoint.

  • Check that a handler for the specific path exists and is available.

  • Check the server code or configuration to see if a handler is registered for the URL you are trying to use.

  • Check the URL rewrite rules to make sure that they do not change the path so that the request goes to a non-existent handler.

  • Check the server's routing configurations to ensure the endpoint is defined.

404 Not Found error with Ngrok

  • Ensure that your local application is running and accessible on the same port you have specified in Ngrok.

  • Review the Ngrok logs (available in the Ngrok web interface at http://127.0.0.1:4040) to see traffic details and possible routing errors.


405 Method Not Allowed

Cause: The HTTP method used is not allowed for the requested resource.

Solution: Check the server's configurations to allow the HTTP method being used, or ensure the correct method is used for the API endpoint.

1. Configuring Apache Server

If your server runs on Apache, you can use the .htaccess file to allow or disallow specific methods. Here's how you can enable POST requests for all resources:

<Directory "/var/www/html">
    AllowOverride All
    Order allow,deny
    Allow from all
    <LimitExcept GET POST>
        Deny from all
    </LimitExcept>
</Directory>

This code configures Apache to allow GET and POST requests, denying all other types of requests.

2. Configuring NGINX

For NGINX servers, you can add or modify the existing server configuration file to allow POST methods:

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;

        # Allow POST
        limit_except POST {
            deny all;
        }
    }
}

This configuration solves the problem by restricting access to methods other than POST.

3. Configuring IIS (Internet Information Services)

In IIS, you can manage allowed methods via the graphical user interface or configuration files:

  • Open IIS Manager.

  • Select the site or application you want to configure.

  • Go to the โ€œHandler Mappingsโ€ section.

  • Modify or add new mappings to allow the POST method.

4. Configuring Application Servers

For application servers such as Tomcat or Jetty, you can configure allowed methods in your application code, for example, by adding checks on the request method in your servlet or controller.

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // Handling POST request
}

In this code, the servlet handles only POST requests, which prevents the 405 error for POST.


500 Internal Server Error

Cause: The server encountered an unexpected condition that prevented it from fulfilling the request.

Solution: Check server logs to diagnose the issue. It could be due to a coding error, failed dependencies, or resource limitations. Debug and fix the issue based on specific error details from the logs.


502 Bad Gateway

Cause: The server, while acting as a gateway or proxy, received an invalid response from the upstream server.

Solution: Verify the configuration and status of upstream servers. Ensure that the proxy server is correctly routing requests and that all servers in the chain are running properly.


503 Service Unavailable

Cause: The server is currently unable to handle the request due to temporary overloading or maintenance.

Solution: If itโ€™s a temporary load issue, consider implementing load balancing or increasing server capacity. If maintenance is the cause, wait until it completes, or notify users of downtime.


525 SSL Handshake Failed

Cause: SSL handshake between the clientโ€™s server and the server itโ€™s communicating with failed.

Solution: Check SSL certificates for validity, expiration, and proper configuration. Ensure that the server supports the cryptographic protocols used by the client.

After selecting a channel, a unique URL will be set in the channel settings. Callbacks of selected events will be sent to this URL and displayed on this page, which updates every 10 seconds. By default, the webhook mode is set to โ€œmethodโ€; change this in the channel settings if needed. For more events, specify the additional events in the channel settings. Read more about .

and extract it. Open the terminal and navigate to the folder where Ngrok is stored. Run ./ngrok http PORT_NUMBER, replacing PORT_NUMBER with the port your Express server is running on locally. Now you should have a public URL that you can use as a URL for your webhook.

Localtunnel: A simple and convenient service that allows you to expose your local servers to the Internet.

Serveo: A free service that allows you to create a tunnel to your local server without the need to install additional tools.

Pagekite: A reliable solution for exposing local servers, supporting multiple protocols and easy to configure.

Telebit: Secure tunneling with encryption support, suitable for safe access to local resources.

Beeceptor: A service for creating mock servers and tunneling, allowing you to test and debug APIs.

Eclipse Che: A cloud development environment that includes tunneling capabilities.

webhook setting
Download Ngrok from the official website
https://localtunnel.github.io/www/
https://serveo.net/
https://pagekite.net/
https://telebit.cloud/
https://beeceptor.com/
https://eclipse.dev/che/
https://panel.whapi.cloud/tools/webhook-testingpanel.whapi.cloud
Get a test Webhook server to debug your implementation
How to receive messages from WhatsApp API Webhook locally using Ngrok
Webhook.site - Test, process and transform emails and HTTP requests
This tool allows you to simulate a Post request to the address you specify
Emulates a test callback to your link
Test webhookWhapi Cloud - Whatsapp API for developers
Webhook testing interface with an example of an incoming callback
Example of a notice received
Example of the link obtained in Ngrok
Logo
Logo