Quick Start
One page summary of how to start WhatsApp HTTP API.
On this page you’re going to install WAHA, run it, authenticate the client using QR code and send the first text message to WhatsApp!
Requirements
Only thing that you must have - installed docker. Please follow the original instruction how to install docker ->.
When you are ready - come back and follows the below steps to send the first text message to WhatsApp via HTTP API!
Why Docker?
Docker makes it easy to ship all-in-one solution with the runtime and dependencies. You don’t have to worry about language-specific libraries or chrome installation.
Also, Docker makes installation and update processes so simple, just one command!
Send your first message
We will guide you through the necessary steps to successfully send your first text message using WhatsApp HTTP API.
We’ve got you covered! Watch the video below to see how to send your first message using WAHA.
1. Download image
Assuming you have installed Docker, let’s download the image.
For Core version the command is
docker pull devlikeapro/whatsapp-http-api
For Plus version, we use login to get the image before:
docker login -u devlikeapro -p {KEY}
docker pull devlikeapro/whatsapp-http-api-plus
docker logout
Read more about how to get PASSWORD
for Plus Version →
1.1 Download image on ARM
If you’re using ARM (like Apple Silicon, Apple M1, etc.) - use following commands to download the image
For Core version the command is
# Download the image
docker pull devlikeapro/whatsapp-http-api:arm
# Rename it, so you can use devlikeapro/whatsapp-http-api image in other place
docker tag devlikeapro/whatsapp-http-api:arm devlikeapro/whatsapp-http-api
For Plus version the command is:
docker login -u devlikeapro -p {KEY}
docker pull devlikeapro/whatsapp-http-api-plus:arm
docker logout
# Rename it, so you can use devlikeapro/whatsapp-http-api image in other place
docker tag devlikeapro/whatsapp-http-api-plus:arm devlikeapro/whatsapp-http-api-plus
2. Run WhatsApp HTTP API
Run WhatsApp HTTP API:
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000
Open the link in your browser http://localhost:3000/ and you’ll see API documentation (Swagger).
3. Start a new session
To start a new session you should have your mobile phone with installed WhatsApp application close to you.
Please go and read how what we’ll need to a bit later: How to log in - the instruction on WhatsApp site
When your ready - find POST /api/session/start
, click on Try it out, then Execute a bit below.
The example payload:
{
"name": "default"
}
By using the request with name
values you can start multiple session (WhatsApp accounts) inside the single docker
container in Plus
version and only one account in Core version.
Read more about multiple sessions →
4. Get and scan QR
Find GET /api/screenshot
and execute it, it shows you QR code.
Scan the QR with your cell phone’s WhatsApp app.
5. Get the screenshot
Execute GET /api/screenshot
after a few seconds after scanning the QR - it’ll show you the screenshot of you Whatsapp
instance. If you can get the actual screenshot - then you’re ready to start sending messages!
6. Send a text message
Let’s send a text message - find POST /api/sendText
in swagger and change chatId
this
way: use a phone international phone number without +
symbol and add @c.us
at the end.
For phone number 12132132131
the chatId
is 12132132131@c.us
.
The example payload:
{
"chatId": "12132132130@c.us",
"text": "Hi there!",
"session": "default"
}
Also, you can use curl
and send POST request like this:
# Phone without +
export PHONE=12132132130
curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP API\" }" -H "Content-Type: application/json" -X POST http://localhost:3000/api/sendText
What is next?
- Learn about the easiest way to manage your WhatsApp sessions - Dashboard ->
- Right now you’ve sent simple text message, but you can send more! Send messages ->
- Read how to receive and response to messages Receive messages ->
- Save session information, so you don’t have to scan QR after container restart ->
- Make sure your API is properly protected ->