API REST para WhatsApp

Easyzap é uma implementação da biblioteca whatsmeow como um serviço REST simples, com suporte a múltiplos dispositivos e sessões simultâneas.

Principais Recursos

Easyzap oferece uma API completa para interagir com o WhatsApp de forma eficiente, sem uso de recursos pesados como Puppeteer ou emuladores Android.

Alta Performance

Comunicação direta com os servidores do WhatsApp via websocket, reduzindo consumo de memória e CPU.

Múltiplas Sessões

Suporte a vários dispositivos e usuários simultaneamente na mesma instância.

Mensagens Ricas

Envie texto, imagens, áudios, documentos, vídeos, figurinhas, localização e contatos.

Webhooks

Configure webhooks para receber notificações em tempo real de eventos e mensagens.

Verificação de Usuário

Verifique se números possuem WhatsApp e obtenha informações de perfil.

Autenticação Simples

Sistema de token para autenticação fácil e segura.

Endpoints da API

Easyzap oferece diversos endpoints para interagir com o WhatsApp, organizados por categoria.

Session

Manage WhatsApp sessions with ease.

  • Connect to WhatsApp
  • Disconnect, Logout
  • Check connection status
  • Get QR Code for scanning
  • Pair by Phone Number
  • Proxy configuration

Chat

Interact with chats and messages.

  • Mark messages as read
  • Delete messages
  • Send reactions to messages
  • Set presence (typing/recording)
  • Download images
  • Download videos
  • Download documents

Messages

Send different types of messages.

  • Text, images, audio
  • Documents, videos, stickers
  • Location, contacts
  • Templates with buttons

Users

Get information about users.

  • Check if numbers have WhatsApp
  • Get profile information
  • Get avatar/profile picture
  • List contacts
  • Set global presence

Groups

Manage WhatsApp groups.

  • List subscribed groups
  • Get group information
  • Get invite link
  • Change group name
  • Change group picture

Webhooks

Configure notifications for events.

  • Set webhook URL
  • Subscribe to specific events
  • Update configuration
  • Remove webhook

Interactive Demo

Veja como é simples utilizar a API Easyzap para interagir com o WhatsApp.

W

Assistente Easyzap

Online

Important Warning

Using this software in violation of WhatsApp's Terms of Service may result in your number being banned. Be very careful, do not use it for SPAM or anything similar. Use at your own risk. If you need to develop something with commercial interest, contact a global WhatsApp solution provider and sign up for the WhatsApp Business API service.

How to Use

Instruções para começar a usar o Easyzap rapidamente.

Prerequisites

Para executar o Easyzap, você precisa de:

  • Go (Go Programming Language)
  • Docker (optional, for containerization)
  • Postgres (optional, can work standalone using SQLite)

Compilation

Compile the project with the following command:

go build .

Configuration

Easyzap utiliza um arquivo .env para configuração. Estes são os ajustes necessários:

For PostgresSQL

# EASYZAP_ADMIN_TOKEN é o padrão. Variáveis legadas ADMIN_TOKEN e WUZAPI_ADMIN_TOKEN também são aceitas.
EASYZAP_ADMIN_TOKEN=seu_token_aqui
USER=easyzap
PASSWORD=easyzap
NAME=easyzap
HOST=localhost
PORT=5432
America/New_York

For SQLite

# EASYZAP_ADMIN_TOKEN é o padrão. Variáveis legadas ADMIN_TOKEN e WUZAPI_ADMIN_TOKEN também são aceitas.
EASYZAP_ADMIN_TOKEN=seu_token_aqui
TZ=America/New_York

Execution

By default, the service will start on port 8080. You can change the behavior with the following parameters:

  • -address: defines the IP address to bind the server (default 0.0.0.0)
  • -port: defines the port number (default 8080)
  • -logtype: format for logs, console (default) or json
  • -wadebug: enables whatsmeow debug, INFO or DEBUG levels are supported
  • -sslcertificate: SSL Certificate File
  • -sslprivatekey: SSL Private Key File
  • -skipmedia: Do not automatically download media from received messages
  • -osname: Connection OSName in Whatsapp (default "Mac OS 10")
  • -admintoken: Security Token to authorize admin actions (list/create/remove users)
Example:
./easyzap -logtype json

Creating Users

To open sessions, you first need to create a user and define an authentication token for it. You can do this login into the Dashboard, or using the API directly:

curl -X POST http://localhost:8080/admin/users \
-H "Authorization: $EASYZAP_ADMIN_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"name": "John", "token": "Z1234ABCCXD"}'

Once users are created, you can communicate with the API by passing the Token header as a simple authentication method. You can have multiple users (different numbers) on the same server. For every user you will need to Connect to whatsapp and then either scan a QR Code or Pair via phone number.

Web Resources

The daemon also serves some static web files, useful for development/testing that you can load with your browser:

  • A Swagger API reference at /api
  • An example web page to connect and scan QR codes at /login (where you will need to pass ?token=1234ABCD)
  • A management dashboard at /dashboard