Skip to content

Commit fc3d790

Browse files
authored
chore: update readme
Removed Portuguese documentation and related sections from README.
1 parent 21344cc commit fc3d790

1 file changed

Lines changed: 0 additions & 205 deletions

File tree

README.md

Lines changed: 0 additions & 205 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
HTTP service for WhatsApp messages. Built on [whatsapp-web.js](https://wwebjs.dev/).
77

8-
[Documentação em Português](#pt-br)
9-
108
## Features
119

1210
- Send text and media messages via REST API
@@ -161,206 +159,3 @@ curl -X POST http://localhost:3000/sessions/my-session/messages \
161159
## License
162160

163161
MIT License - see [LICENSE](./LICENSE).
164-
165-
Construído com ❤️ sobre [whatsapp-web.js](https://wwebjs.dev/)
166-
167-
---
168-
169-
<a name="pt-br"></a>
170-
171-
# WhatsApp HTTP - Serviço HTTP WhatsApp
172-
173-
HTTP service para mensagens WhatsApp. Construído sobre [whatsapp-web.js](https://wwebjs.dev/).
174-
175-
## Recursos
176-
177-
- Envie mensagens de texto e mídia via REST API unificada
178-
- Suporte a áudio (MP3, OGG, notas de voz)
179-
- Imagens, vídeos e documentos
180-
- Autenticação por QR code com timeout de 60s
181-
- Múltiplas sessões isoladas
182-
- Substituição de sessão sem perder autenticação
183-
- Autenticação Bearer token
184-
- Persistência via volumes Docker
185-
186-
## Início Rápido
187-
188-
```bash
189-
# Clone e configure
190-
git clone https://github.com/caiopizzol/whatsapp-web-api.git
191-
cd whatsapp-web-api
192-
export AUTH_TOKEN=seu-token-secreto-aqui
193-
194-
# Execute com Docker
195-
docker-compose up -d
196-
197-
# Verificar logs
198-
docker-compose logs -f whatsapp
199-
```
200-
201-
## Uso da API
202-
203-
### 1. Criar Sessão
204-
205-
```bash
206-
curl -X POST http://localhost:3000/sessions \
207-
-H "Authorization: Bearer SEU_TOKEN" \
208-
-H "Content-Type: application/json"
209-
```
210-
211-
### 2. Obter QR Code
212-
213-
```bash
214-
curl -H "Authorization: Bearer SEU_TOKEN" \
215-
http://localhost:3000/sessions/minha-sessao/qr
216-
```
217-
218-
Escaneie o QR code com WhatsApp no celular.
219-
220-
### 3. Enviar Mensagens
221-
222-
O endpoint `/messages` lida com texto e mídia:
223-
224-
```bash
225-
# Mensagem de texto
226-
curl -X POST http://localhost:3000/sessions/minha-sessao/messages \
227-
-H "Authorization: Bearer SEU_TOKEN" \
228-
-H "Content-Type: application/json" \
229-
-d '{
230-
"to": "5511999887766",
231-
"text": "Olá do WhatsApp HTTP!"
232-
}'
233-
234-
# Mensagem de áudio
235-
curl -X POST http://localhost:3000/sessions/minha-sessao/messages \
236-
-H "Authorization: Bearer SEU_TOKEN" \
237-
-H "Content-Type: application/json" \
238-
-d '{
239-
"to": "5511999887766",
240-
"media": {
241-
"url": "https://example.com/audio.mp3"
242-
},
243-
"options": {
244-
"caption": "🎵 Escute isso!"
245-
}
246-
}'
247-
248-
# Nota de voz
249-
curl -X POST http://localhost:3000/sessions/minha-sessao/messages \
250-
-H "Authorization: Bearer SEU_TOKEN" \
251-
-H "Content-Type: application/json" \
252-
-d '{
253-
"to": "5511999887766",
254-
"media": {
255-
"url": "https://example.com/voice.ogg"
256-
},
257-
"options": {
258-
"sendAudioAsVoice": true
259-
}
260-
}'
261-
```
262-
263-
## Principais Endpoints
264-
265-
- `POST /sessions` - Criar sessão
266-
- `GET /sessions/{id}` - Status da sessão
267-
- `GET /sessions/{id}/qr` - QR code (timeout 60s)
268-
- `POST /sessions/{id}/messages` - Enviar mensagem (texto ou mídia)
269-
- `DELETE /sessions/{id}` - Deletar sessão
270-
- `GET /health` - Status do serviço
271-
272-
## Configuração
273-
274-
```bash
275-
# Obrigatório
276-
AUTH_TOKEN=seu-token-secreto-aqui
277-
278-
# Opcional (com padrões no Docker)
279-
PORT=3000
280-
NODE_ENV=production
281-
```
282-
283-
## Deploy Docker
284-
285-
### Usando Docker Hub
286-
287-
```yaml
288-
# docker-compose.yml
289-
services:
290-
whatsapp:
291-
image: cpolive/whatsapp-web-api:1.4.0 # Or use :latest for latest version
292-
ports:
293-
- '3000:3000'
294-
environment:
295-
- AUTH_TOKEN=${AUTH_TOKEN:-your-secret-token-here}
296-
- PORT=${PORT:-3000}
297-
- NODE_ENV=${NODE_ENV:-production}
298-
volumes:
299-
- ./whatsapp-sessions:/app/.wwebjs_auth
300-
restart: unless-stopped
301-
mem_limit: 1g
302-
cpus: '1.0'
303-
304-
volumes:
305-
whatsapp-sessions:
306-
driver: local
307-
```
308-
309-
### Construindo a partir do código fonte
310-
311-
```yaml
312-
# docker-compose.yml
313-
services:
314-
whatsapp:
315-
build: .
316-
ports:
317-
- '3000:3000'
318-
environment:
319-
- AUTH_TOKEN=${AUTH_TOKEN:-your-secret-token-here}
320-
- PORT=${PORT:-3000}
321-
- NODE_ENV=${NODE_ENV:-production}
322-
volumes:
323-
- ./whatsapp-sessions:/app/.wwebjs_auth
324-
restart: unless-stopped
325-
mem_limit: 1g
326-
cpus: '1.0'
327-
328-
volumes:
329-
whatsapp-sessions:
330-
driver: local
331-
```
332-
333-
**Nota**: As sessões são persistidas no diretório `./whatsapp-sessions` do host.
334-
335-
## Recursos Necessários
336-
337-
- **RAM**: ~512MB por sessão (Chromium)
338-
- **CPU**: 1 vCPU
339-
- **Armazenamento**: 1GB
340-
341-
## ⚠️ Limitações
342-
343-
- **Intensivo em recursos** (~512MB RAM para Chromium)
344-
- **QR timeout**: 1 por 60 segundos por sessão
345-
- **Não oficial**: WhatsApp não suporta bots em contas pessoais
346-
- **Rate limiting**: Implemente no seu gateway
347-
348-
## Desenvolvimento
349-
350-
```bash
351-
npm install
352-
npm run dev # Hot reload
353-
npm test # Testes integração
354-
npm run lint # Verificar código
355-
```
356-
357-
## Segurança
358-
359-
- Nunca exponha diretamente à internet
360-
- Use proxy reverso ou API gateway
361-
- AUTH_TOKEN forte (mín 32 chars)
362-
- Execute em rede isolada
363-
364-
## Licença
365-
366-
MIT License - veja [LICENSE](./LICENSE).

0 commit comments

Comments
 (0)