40 lines
1.4 KiB
Markdown
40 lines
1.4 KiB
Markdown
# APIs Externas
|
|
|
|
## EvolutionAPI
|
|
|
|
- **Propósito:** Gerenciar instâncias WhatsApp
|
|
- **Documentação:** [EvolutionAPI Docs](https://doc.evolution-api.com/)
|
|
- **Base URL:** `{EVOLUTION_API_URL}` (env var)
|
|
- **Autenticação:** Bearer token `{EVOLUTION_API_KEY}`
|
|
- **Rate Limits:** Não documentado
|
|
|
|
**Endpoints Principais:**
|
|
- `GET /instance/fetchInstances` - Listar instâncias (verificar docs)
|
|
- `GET /instance/connect/{instanceName}` - Gerar QR code (verificar docs)
|
|
- `DELETE /instance/logout/{instanceName}` - Desconectar (verificar docs)
|
|
|
|
**Notas de Integração:**
|
|
- **Investigação necessária:** Confirmar endpoints exatos na documentação oficial
|
|
- **Error handling:** Implementar retry com backoff, timeout 10s
|
|
- **Validação:** Verificar que instâncias em `EVOLUTION_INSTANCE_NAMES` existem
|
|
|
|
---
|
|
|
|
## Google Calendar OAuth (via n8n)
|
|
|
|
- **Propósito:** Autorizar integração com Google Calendar
|
|
- **Documentação:** Workflow n8n interno
|
|
- **Base URL:** `{N8N_OAUTH_URL}` (env var)
|
|
- **Autenticação:** N/A (n8n gerencia)
|
|
- **Rate Limits:** N/A
|
|
|
|
**Endpoints:**
|
|
- `GET {N8N_OAUTH_URL}?user_id={userId}&redirect_uri={callbackURL}` - Inicia OAuth
|
|
|
|
**Notas de Integração:**
|
|
- **Redirect flow:** Portal → n8n → Google → n8n → Portal callback
|
|
- **Callback:** `/api/google-calendar/callback?success=true&email={email}` ou `?error={msg}`
|
|
- **Reconectar:** Mesmo fluxo atualiza email conectado
|
|
|
|
---
|