It is inspired base on https://github.com/pedroslopez/whatsapp-web.js
- npm install.
- The server will start on port 3030 (http://127.0.0.1:3030).
- Access to /generate (GET REQUEST) to generate QR code for Whatsapp API.
- Copy the imageUrl response, open it on browser, and scan it with your Whatsapp app.
- After you got the "Client is Ready!" response in the console, you can now send message or send media message to other Whatsapp User.
Make a POST REQUEST to /sendMessage with JSON body, number and message.
Example :
{ "number": "6285267671232", "message": "Hello world" }
If you want to send to multiple number (add coma "," in number), here is the example :
{ "number": "6285267671232, 6287812123434, 6282132321212", "message": "Hello world" }
Please note that the phone number format is an international format without + sign.
Make a POST REQUEST to /sendMedia with form-data (Form Data) body, file, message and number.
file : file to upload
number : number to send
message : caption for file
Example (Multiple Numbers) :
file : media.pdf (file)
number : 6285267671232, 628231212444, 625234345656 (String or Number)
message: this is the test caption (String or Number)
Example (Single Number) :
file : media.pdf (file)
number : 6285267671232 (String or Number)
message: this is the test caption (String or Number)
Please note that the phone number format is an international format without + sign.