Giter VIP home page Giter VIP logo

wapi-1's Introduction

WAPI

Test

Simple REST API wrapper for the super awesome whatsapp-web.js

Setup

With Docker:

  1. Clone repo
  2. Copy config.example.json to config.json and set desired user & password (for Basic Authentication) and port (for API server)
  3. Build: docker build -t wapi:latest .
  4. Run: docker run --name wapi -e DOCKERIZED=1 -p 4000:4000 -d wapi:latest

Without Docker:

  1. Clone repo
  2. Copy config.example.json to config.json and set desired user & password (for Basic Authentication) and port (for API server)
  3. Run npm install
  4. Run npm start

Development

With Docker:

docker run --name wapi-dev -e DOCKERIZED=1 -p 4000:4000 -d -v $PWD:/home/api wapi:latest
docker exec -u 0 -it wapi-dev bash

API

All APIs require Basic Authentication using the user & password in config.json:

  1. GET /

    Health check

  2. GET /qr

    Get authentication QR code image

  3. POST /send

    Send a message to an individual or group chat (number can contain phone number with country code or a group id) Example:

     {
       "number":"6288290764816",
       "message":"Hello world ๐Ÿ™",
       "attachments": [{"filename": "hello.txt", "mime":"text/plain", "content":"aGVsbG8K"}]
     }
    
  4. GET /groups

    Get list of groups (id and name) where this account is included

  5. GET /webhooks

    Get all webhooks

  6. POST /webhooks

    Add a webhook: Example:

     {
         "postUrl": "http://localhost:4000/test",
         "authHeader": "Basic c2VjcmV0Cg==",
         "eventCode": "INCOMING_MESSAGE"
     }
    
  7. DELETE /webhooks/:id

    Delete a webhook

wapi-1's People

Contributors

yohanesgultom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.