Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

andremacola/whp-api

Repository files navigation

THIS IS A WORKING PROJECT.

Whatsapp REST API for wa-automate-nodejs

This is a basic example how to create a REST API for Whatsapp. Not for production use (yet).

HOW TO USE

  1. Set ambient variables inside .env file (see .env.example for more information). MYGROUP and MYNUMBER is only for development purpose.
  2. yarn install or npm install
  3. yarn start-server

ENDPOINTS

Command Endpoint
Send (POST): http://localhost:3000/SESSION_TOKEN/send
Info (GET): http://localhost:3000/SESSION_TOKEN/status
Stop (GET): http://localhost:3000/SESSION_TOKEN/stop
Start (GET): http://localhost:3000/SESSION_TOKEN/start

SEND EXAMPLES

// Text message (for groups use @g.us)

{
  "cmd": "chat",
  "to": "[email protected]",
  "msg": "some message"
}

// Audios (audio/ogg, audio/mpeg)

{
  "cmd": "media",
  "to": "[email protected]",
  "url": "https://domain.tld/audio.mp3"
}

// Images (image/jpeg, image/png, image/gif)

{
  "cmd": "media",
  "to": "[email protected]",
  "url": "https://domain.tld/image.jpg",
  "msg": "some caption (optional)"
}

// Link or Youtube videos

{
  "cmd": "link",
  "to": "[email protected]",
  "url": "https://github.com",
  "msg": "some message (optional)"
}

WEBHOOKS

Set webhook url on .env file. The api will send a post with every message or ack events

About

Whatsapp Rest API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published