This projects uses @WPPConnect lib to send automated messages on Whatsapp.
Node, Express, Typescript, Awilix, WPPConnect
Clone the project
git clone https://github.com/rodriguesabner/server-whatsapp
Go to the project directory
cd server-whatsapp
Install dependencies
yarn
Start the server
yarn start
To run this project, you will need to add the following environment variables to your .env.development file
PORT
- Multi Sessions
- Send text message
- Send image message
- Send location message
- Send video message
Collection Postman 👇
https://www.postman.com/gold-equinox-442131/workspace/wppconnect
POST /${FROM_PHONE_NUMBER_ID}/start
Parameter | Type | Description |
---|---|---|
FROM_PHONE_NUMBER_ID |
string |
Required. Session name or Number Device |
POST /${FROM_PHONE_NUMBER_ID}/messages
Parameter | Type | Description |
---|---|---|
FROM_PHONE_NUMBER_ID |
string |
Required. Session name or Number Device |
Body:
{
"to": "NUMBER_HERE, MULTIPLE_NUMBERS_ACCEPTED",
"type": "text",
"recipient_type": "individual",
"text": {
"body": "Oi"
}
}
Check interface to send another types (location, image...): https://github.com/rodriguesabner/server-whatsapp/blob/master/src/interface/message.ts#L35
- Unit tests