Code Monkey home page Code Monkey logo

baileys-api's Introduction

Baileys API

An implementation of @whiskeysockets/Baileys as a simple RESTful API service with multiple device support. This project implements both Multi-Device client so that you can choose and use one of them easily.

Requirements

  • NodeJS version 14.5.0 or higher.

Installation

  1. Download or clone this repo.
  2. Enter to the project directory.
  3. Install the dependencies.

.env Configurations

# Listening Host
HOST=127.0.0.1

# Listening Port
PORT=8000

# Maximum Reconnect Attempts
MAX_RETRIES=5

# Reconnect Interval (in Milliseconds)
RECONNECT_INTERVAL=5000

Usage

  1. You can start the app by executing npm run start or node ..
  2. Now the endpoint should be available according to your environment variable configurations. Default is at http://localhost:8000.

Also check out the examples directory for the basic usage examples.

API Docs

The API documentation is available online here. You can also import the Postman Collection File (postman_collection.json) into your Postman App alternatively.

The server will respond in following JSON format:

{
    success: true|false, // bool
    message: "", // string
    data: {}|[] // object or array of object
}

Available Features

At this moment we are working to bring more functionalities

Autentication

* ApiKey (By default it is not active, change it in env by adding your custom key)

Sessions

* Find Session
* Session Status
* List Sessions
* Create New Session
    => QR method (Default)
    => Pairing Code method
* Delete Session

Chats

* Get Chat List
* Get Conversation
* Forward Message
* Send Presence Update
* Read Message
* Send  Bulk Message
* Send Message Types
    => Send Message Text
    => Send Message Image
    => Send Message Audio
    => Send Message Video
    => Send Message Document
    => Send Message Gif
    => Send Message Sticker
    => Send Message Contact
    => Send Message Location
    => Send Message React
    => Send Message List
    => Send Message Buttons
    => Send Message Template
    => Send Message How To Forward

Groups

* Get Chat List
* Get Conversation
* Get Group Metadata
* Create Group
* Group Update Participants
* Group Update Subject
* Group Update Description
* Group Update Settings
* Group Get Invite Code
* Group Join Invite Code
* Group Revoke Invite Code
* Group Update Picture
* Group List Without Participants

Misc

* Update Profile Status
* Update Profile Name
* Update Progile Image (NEW)
* Get My Profile {name, phote, status} (NEW)
* Get Profile User (NEW)
* Block And Unblock User (NEW)

Webhook

* Global webhook

Known Issue

Currently there's no known issues. If you find any, please kindly open a new one.

Notes

  • The app only provide a very simple validation, you may want to implement your own.
  • When sending message, your message property will not be validated, so make sure you sent the right data!
  • There's no authentication, you may want to implement your own.
  • The Beta Multi-Device client use provided Baileys's makeInMemoryStore method which will store your data in memory and a json file, you may want to use a better data management.
  • Automatically reading incoming messages is now disabled by default. Uncomment whatsapp.js:91-105 to enable this behaviour.
  • If you have problems when deploying on CPanel or any other similar hosting, transpiling your code into CommonJS should fix the problems.

Notice

This project is intended for learning purpose only, don't use it for spamming or any activities that's prohibited by WhatsApp.

baileys-api's People

Contributors

ookamiiixd avatar andresayac avatar dgbkn avatar dependabot[bot] 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.