Skip to content

This project provides a simple WhatsApp API using whatsapp-web.js. The service is containerized using Docker for easy deployment and scalability.

License

Notifications You must be signed in to change notification settings

reynaldiarya/WhatsApp-API-Unofficial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp API Unofficial

This project provides a simple WhatsApp API using whatsapp-web.js. The service is containerized using Docker for easy deployment and scalability.

Requirements

  • Docker installed on your system
  • Access to the terminal/command prompt

Getting Started

Step 1: Build the Docker Image

Use the following command to build the Docker image:

docker build -t whatsapp-api:v1 .

Step 2: Run the Container

Run the Docker container and expose the service on port 5000:

docker run -p 3000:3000 --name whatsapp-api --restart unless-stopped whatsapp-api:v1

Step 3: Access the Service

The service will be accessible at:

http://localhost:3000/api/send

Example Requests

Send Message Request

Make a POST request to the /api/send endpoint with user credentials:

curl -X POST http://localhost:3000/api/send \
     -H "Content-Type: application/json" \
     -H "Authorization: <your-token>" \
     -d '{
           "phone": "+6201111111111",
           "message": "Alo"
         }'

Error Response

If authentication fails, you will receive an error message:

{
  "status": "false",
  "message": "Error",
  "meta": "Not Authorized"
}

Stopping and Removing the Container

To stop the running container:

docker stop whatsapp-api

To remove the container:

docker rm whatsapp-api

Notes

  • Ensure that port 3000 is not being used by other services.
  • Use --restart unless-stopped to automatically restart the container if it stops unexpectedly.

About

This project provides a simple WhatsApp API using whatsapp-web.js. The service is containerized using Docker for easy deployment and scalability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •