This document shows you how to make WhatsApp Business API requests and what the returned responses might look like.
You can use the WhatsApp-provided Postman Collection or cURL API calls to send requests.
A valid HTTP request includes the following components:
POST
, GET
, DELETE
, PATCH
and PUT
.Content-Type
in the header (e.g.,“Content-Type: application/json”
). This uses UTF-8 character encoding, and charset=utf-8
is the default for application/json
.This cURL API request example of the WhatsApp Business API format uses the contacts
node:
curl -X POST \ https://your-webapp-hostname:your-webapp-port/v1/contacts \ -H 'Authorization: Bearer your-auth-token' \ -H 'Content-Type: application/json' \ -d '{ "blocking": "wait", "contacts": [ "6315551000", "6315551002", "631-555-1005" ] }'
your-webapp-hostname
is the hostname, FQDN or IP address, where the Webapp container or the load balancer runs. your-webapp-port
is optional and required only if either the load balancer listens on or if the Webapp container is mapped to a non-standard HTTPS port. Note: If using Docker to run your WhatsApp Business API client, you can run the docker ps
command to find the port. /v1/contacts
is the endpoint to send the data request to your-auth-token
is obtained after you log in using the /v1/users/login
endpoint. See the Login and Authentication documentation for more information.-d @filepath`
.A WhatsApp Business API response has the following components:
In this example, the payload is contacts
because we sent a request to the contacts
endpoint in the above request example.
Note: Normally in a successful response, errors
would not be present; they are included here purely as an example.
200 OK { "contacts": [ { "input": "1-631-555-1002", "status": "valid", "wa_id": "16315551002" }, { "input": "6315551003", "status": "valid", "wa_id": "16315551003" } ], "meta": { "version": "whatsapp-business-api-client-version", "api_status": "deprecated" | "experimental" | "stable" } "errors": [{ "code": error-code, "title": "error-code-title", "details": "optional-detailed-error-message" }] }