The WhatsApp Business API client has certain network requirements for connecting to WhatsApp servers. If your business cannot do the below, we unfortunately cannot support your WhatsApp integration. If you have done the below and you are still unable to send messages, please see Debugging Your Network for more information.
The WhatsApp Business API client requires a long-lived TCP connection. Occasional requests will be made so the connection does not stay idle. However, you will have to ensure that your firewall, router, security, etc. do not terminate long-lived TCP connections.
This document covers:
There are two ports used for outgoing traffic:
They are not listening or used for incoming traffic. Your business's firewall can still protect from incoming traffic as normal.
The default port for the WhatsApp Business API client is
5222. If that port is not available, the application will fallback to port
443 needs to be opened for
HTTPS at the minimum for application registration and restarts. You can leave port
5222 closed and have port
443 open, but you cannot just open port
5222 and not port
See the Debugging Your Network — Port documentation if you wish to configure the WhatsApp Business API client to only use port
It is recommended that you open both ports and allow all outgoing traffic.
The WhatsApp Business API client uses two types of protocols:
The WhatsApp proprietary chat protocol, called
chatd, is used to send the encrypted messages and information to and from the WhatsApp servers. Because it is proprietary, we ask the port you open to be whitelisted for all outgoing traffic. Some firewalls and proxies terminate non-SSL connections which will interfere with the application's ability to connect to WhatsApp servers.
HTTPS during the registration step and it is necessary for restarts. We do not recommend blocking
HTTPS after registration because you never know when you will have to re-register or restart your application.
WhatsApp uses a wide range of IP addresses for its servers. You can try to allow all of the IP addresses. However, it is best to just allow all outgoing traffic and connections from the above ports.List of the WhatsApp server IP addresses and ranges (ZIP)
You can test by connecting to a single server while your business's infrastructure/security team configures your network by following directions in the Debugging Your Network documentation.