Ogmma API
website·Indexed 30 days ago
https://developer.ogmma.com.brAn API-first platform for sending and receiving messages, featuring endpoints for text, audio, video, and image communication. The documentation covers authentication via API Keys, webhook event management, conversation handling, bulk template sending, and contact imports via CSV.
What's inside Ogmma
- The Bulk Send feature allows sending the same message to multiple recipients simultaneously, ideal for marketing campaigns and large-scale notifications. The API queues messages and sends them sequentially with a configurable interval to prevent account bans for excessive sending.
Overview of Ogmma Webhooks
Webhooks allow real-time notifications from the Ogmma platform. Instead of polling for changes, Ogmma sends an HTTP POST request to a configured HTTPS URL whenever a relevant event occurs. The receiving application must process the payload and return an HTTP2xxstatus code to confirm receipt.Overview of n8n for Ogmma API Integration
n8n is an open-source visual workflow automation platform that allows users to connect services and APIs via a drag-and-drop interface. It can be used in two modes: n8n Cloud (hosted) or Self-hosted (via Docker or npm). When integrated with the Ogmma API, it enables automation of WhatsApp communication, such as sending messages from CRMs/ERPs, processing incoming webhooks for auto-responses, synchronizing contact data, and building AI-powered chatbots.Retrieve full details of a specific conversation
Use theGET /v1/conversations/:idendpoint to retrieve complete data for a specific conversation. This includes detailed information about the contact, communication channel, assigned agent, department, current status, and timestamps. This endpoint should be called to gather all necessary details before performing operations such as assignment, transfer, or closing a conversation.curl --request GET \ --url https://oapi.ogmma.com.br/v1/conversations/{id} \ --header 'Authorization: Bearer {API_KEY}'Manage multi-tenancy with institutionId
Ogmma API uses aninstitutionIdto isolate data between different companies. This ID ensures that channels, contacts, and conversations are private to each institution. Developers do not need to pass theinstitutionIdmanually in requests; it is automatically extracted from the provided API Key or JWT token.Use the Ogmma API Sandbox for testing
The Sandbox is a testing environment that simulates sending and receiving WhatsApp messages without requiring a real phone number. It allows developers to test integrations with the Ogmma API without impacting production channels. All requests made with a test API key are automatically routed to the sandbox environment.Understand the Ogmma Conversation lifecycle
A conversation in Ogmma is a grouping of messages exchanged between a channel and a contact. Conversations are created automatically by the API when a message is received from a new contact (or one without an active conversation) or when a message is sent to a contact without an active conversation. Manual creation is not required.Understand the Ogmma media download workflow
When a contact sends media (image, audio, video, or document) via WhatsApp, the Ogmma API automatically processes the file, uploads it to S3 storage, and includes a download URL in themessage.receivedwebhook payload. Developers do not need to interact with WhatsApp directly to retrieve the media; it is available via the provided URL by the time the webhook reaches the destination.Understand WhatsApp channel types in Ogmma
A channel represents an active WhatsApp connection on the Ogmma platform, associated with a specific phone number for sending and receiving messages. There are two supported types:
- WHATSAPP_BAILEYS: Uses the Baileys protocol. Connection is established by scanning a QR Code with a mobile device. The mobile device must remain connected to the internet.
- WHATSAPP_WABA: Uses the official WhatsApp Business API (Meta). Connection is established via Meta Business API credentials. It operates independently of a physical mobile device and is recommended for production at scale.
Ogmma API Overview
Ogmma API is a REST API platform for sending and managing WhatsApp messages. Key capabilities include:
- Sending various message types: text, image, video, audio, document, contact, and location.
- Bulk messaging to multiple contacts.
- Real-time notifications via Webhooks for message status (sent, received, read).
- Sandbox environment for testing without a real WhatsApp number.
- Conversation and contact management.
- Support for WABA (WhatsApp Business API) templates.
- Web-based customer service interface.
- N8N workflow integrations.
Understand message processing and ordering
Ogmma uses Redis to queue messages, which are processed sequentially per conversation. This architecture ensures that the order of messages within a single conversation is preserved and prevents race conditions, while allowing messages for different conversations to be processed in parallel.Ogmma API Architecture Overview
Ogmma API is an API-first platform for sending and managing WhatsApp messages. It uses a multi-tenant architecture where each company (institution) is isolated. The system is split into two main components: the API Server and the Worker, communicating via Redis Pub/Sub and sharing a MongoDB Atlas database.
- API Server: The entry point for REST and WebSocket requests. It handles authentication, validation, business rules, and publishes commands to the Worker.
- Worker: The WhatsApp engine that manages sessions (QR codes, reconnections) and processes the actual sending and receiving of messages. It is agnostic of business rules and permissions.