access our documentation on postman
Wppconnect Server is a ready-to-use API, just download, install, and start using, simple as that.
- Javascript ES6
- NodeJS
- Restfull
Multiple Sessions | ✔ |
Send text, image, video and docs | ✔ |
Get contacts list | ✔ |
Receive messages | ✔ |
Open/Close Session | ✔ |
Change Profile/Username | ✔ |
Create Group | ✔ |
Join Group by Invite Code | ✔ |
Webhook | ✔ |
- WPPConnect
- Axios
- Bcrypt
- Cors
- Dotenv
- Express
- Nodemon
- SocketIO
Install the dependencies and start the server.
yarn install
//or
npm install
yarn dev
yarn build
This server use config.json file to define some options, default values are:
{
/* secret key to genereta access token */
"secretKey": "THISISMYSECURETOKEN",
"host": "http://localhost",
"port": "21465",
// starts all sessions when starting the server.
"startAllSession": true,
"webhook": {
"url": null,
// automatically downloads files to upload to the webhook
"autoDownload": true,
//marks messages as read when the webhook returns ok
"readMessage": false,
//sends all unread messages to the webhook when the server starts
"allUnreadOnStart": true
},
//functionality that archives conversations, runs when the server starts
"archive": {
"enable": true,
//maximum interval between filings.
"waitTime": 10,
"daysToArchive": 45
},
"log": {
"level": "error",
"logger": [ "console", "file" ]
},
"createOptions": {
"browserArgs": ["--no-sandbox"]
}
}
Your secretKey
is inside the config.json
file. You must change the default value to one that only you know.
To generate an access token, you must use your SECRET_KEY
.
Using the route:
curl -X POST --location "http://localhost:21465/api/mySession/eUsouSeCreTo/generate-token"
{
"status": "Success",
"session": "mySession",
"token": "$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe",
"full": "wppconnect:$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe"
}
Save the value of the "full" response. Then use this value to call the routes.
#Starting Session
# /api/:session/start-session
curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
#Get QrCode
# /api/:session/start-session
# when the session is starting if the method is called again it will return the base64 qrCode
curl -X POST --location "http://localhost:21465/api/mySession/start-session" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \$2b\$10\$JcHd97xHN6ErBuiLd7Yu4.r6McvOvEZZDQTQwev2MRK_zQObUZZ9C"
#Send Message
# /api/:session/send-message
curl -X POST --location "http://localhost:21465/api/mySession/send-message" \
-H "Content-Type: application/json; charset=utf-8" \
-H "Accept: application/json" \
-H "Authorization: Bearer \$2b\$10\$8aQFQxnWREtBEMZK_iHMe.u7NeoNkjL7s6NYai_83Pb31Ycss6Igm" \
-d "{
\"phone\": \"5511982743910\",
\"message\": \"*Abner* Rodrigues\"
}"
See the routes file
for all the routes. here and HTTP file.
Swagger ui can be found at /api-docs
wppconnect-server's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.