GithubHelp home page GithubHelp logo

quepasa's Introduction

QuePasa

A (micro) web-application to make web-based WhatsApp bots easy to write.

Built on the library go-whatsapp by Rhymen.

Implemented features:

  • Register a number with WhatsApp
  • Verify a number with a QR code
  • Persistence of account data and keys
  • Exposes HTTP endpoints for:
    • sending messages
    • receiving messages

WARNING: This application has not been audited. It should not be regarded as secure, use at your own risk.

This is a third-party effort, and is NOT in any affiliated with WhatsApp.

Why?

When you need to communicate over WhatsApp from a different service, for example, a help desk or other web-app, QuePasa provides a simple HTTP API to do so.

QuePasa stores keys and WhatsApp account data in a postgres database. It does not come with HTTPS out of the box. Your QuePasa API tokens essentially give full access to your WhatsApp account (to the extent that QuePasa has implemented WhatsApp features). Use with caution.

Usage

Prerequisites

For local development

  • docker
  • golang
  • postgresql

Run using Docker

  • Add info about database migrations
make docker_build
# edit docker-compose.yml.sample to your hearts content
docker-compose up

HTTP API

  1. Use the Accept: application/json header
  2. TOKEN should be treated like a password.

Get bot info

A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot.

request

GET /bot/<TOKEN>/

response

{
    "id": "129f1757-e706-452e-aa1c-4994a95e1092",
    "number": "+15555555552",
    "user_id": "845ae4d0-f2c3-5342-91a2-5b45cb8db57c",
    "token": "8129c0b4-0b96-4486-84fc-c3dd7b03f846",
    "is_verified": true,
    "created_at": "2018-11-02T11:36:24.273Z",
    "updated_at": "2018-11-02T11:36:24.273Z"
}

Sending

request

POST /bot/<TOKEN>/send

{
  "recipient": "+15555555552",
  "messsage": "Hello World!"
}

response

{
  "result": {
    "recipient": "+15555555551",
    "source": "+15555555552",
    "status": "sent",
    "timestamp": "1543420505142"
  }
}

Receive

The "timestamp" query parameter is optional. A maximum of 40 messages per conversation will be returned.

request

GET /bot/<TOKEN>/receive?timestamp=1541265073783

response

{
  "messages": [
    {
      "source": "+15555555551",
      "timestamp": "1541265073894",
      "message": {
        "body": "Hello World!",
        "profileKey": "XXTXQ=="
      }
    }
  ],
  "bot": {
    "id": "129f1757-e706-452e-aa1c-4994a95e1092",
    "number": "+15555555552",
    "user_id": "845ae4d0-f2c3-5342-91a2-5b45cb8db57c",
    "token": "8129c0b4-0b96-4486-84fc-c3dd7b03f846",
    "is_verified": true,
    "created_at": "2018-11-02T11:36:24.273Z",
    "updated_at": "2018-11-02T11:36:24.273Z"
  }
}

License

License GNU AGPL v3.0

QuePasa is a free software project licensed under the GNU Affero General Public License v3.0 (GNU AGPLv3) by The Center for Digital Resilience.

quepasa's People

Contributors

wouter0100 avatar

Stargazers

Viorel-Cosmin Miron avatar

Watchers

Rodolfo Cupertino avatar James Cloos avatar  avatar

Forkers

vasantkumardev

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.