rafardomingos / wppconnect-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WPPConnect Team

WPPConnect Server

Build Status

Wppconnect Server is a ready-to-use API, just download, install, and start using, simple as that.

  • Javascript ES6
  • NodeJS
  • Restfull

Features

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

Libraries Used

  • WPPConnect
  • Axios
  • Bcrypt
  • Cors
  • Dotenv
  • Express
  • Nodemon
  • SocketIO

Installation

Install the dependencies and start the server.

yarn install
//or
npm install

Run Server

yarn dev

Run Server

yarn build

Secret Key

Your SECRET_KEY is inside the .env file. You must change the default value to one that only you know.

Peek 2021-03-25 09-33

Generate Token

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"

Response:

{
  "status": "Success",
  "session": "wppconnect",
  "token": "$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe",
  "full": "wppconnect:$2b$10$duQ5YYV6fojn5qFiFv.aEuY32_SnHgcmxdfxohnjG4EHJ5_Z6QWhe"
}

Using Token

Save the value of the "full" response. Then use this value to call the routes.

Examples

#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"
#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.

About


Languages

Language:JavaScript 99.9%Language:Shell 0.1%