Skip to content

The WhatsApp Web API is a Node.js-based solution that provides a simple interface to send messages through WhatsApp Web. It allows developers to integrate WhatsApp messaging capabilities into their applications with minimal setup. The API handles QR code authentication and provides a secure endpoint for sending messages to any WhatsApp number.

Notifications You must be signed in to change notification settings

yhyasyrian/simple-api-wwebjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Web API

Simple API to send messages to WhatsApp using WhatsApp Web.

Install

npm install

Run

npm run start

How to use

Login

  1. Go to http://localhost:3000/whatsapp/login
  2. Scan the QR code with your WhatsApp account

Send Message

  1. POST: http://localhost:3000/whatsapp/sendmessage
  2. Body:
{
	"phone": "963957999999", // phone number with country code
	"message": "Hello, world!"
}
  1. Headers:
{
	"x-password": "1234567890" // password from .env
}

Notes

  • The phone number must be in the format of the country code and the phone number without the + sign.
  • The message must be in the format of the message to be sent.
  • The password is the password from the .env file.

Integration with Laravel

You can use the following code to send a message to WhatsApp using the API.

use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
  'x-password' => '1234567890'
])->post('http://localhost:3000/whatsapp/sendmessage', [
  'phone' => '963957999999',
  'message' => 'Hello, world!',
]);

Contributing

  1. Fork the repository
  2. Create a new branch
  3. Make your changes and commit them
  4. Push to your branch
  5. Create a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

The WhatsApp Web API is a Node.js-based solution that provides a simple interface to send messages through WhatsApp Web. It allows developers to integrate WhatsApp messaging capabilities into their applications with minimal setup. The API handles QR code authentication and provides a secure endpoint for sending messages to any WhatsApp number.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published