Getting started
In this guide you create an instance, connect the number and send your first message. An instance is a WhatsApp number connected to the API.
In the examples, replace INSTANCIA_ID with your instance’s identifier and TOKEN with its token.
1. Create the instance
Section titled “1. Create the instance”In the dashboard (which is in Portuguese), open Instâncias and click Nova instância. Copy the token: it is shown only once and gives full access to the instance. Store it somewhere safe. If you lose it, generate a new one; the old one stops working.
The identifier (instance ID) is on the instance’s credentials tab, next to the API base address.
2. Start the connection
Section titled “2. Start the connection”curl -X POST https://api.zap.nigora.com.br/v1/instances/INSTANCIA_ID/connect \ -H "Authorization: Bearer TOKEN"The response is 202 with { "connectionStatus": "..." }. It only confirms that the connection has started.
3. Read the QR code
Section titled “3. Read the QR code”curl https://api.zap.nigora.com.br/v1/instances/INSTANCIA_ID/qr \ -H "Authorization: Bearer TOKEN"The response has qr (the code’s text) and image (a PNG as a data: URL, ready to display). While the code is not available, both are null: check again in a few seconds.
On your phone, open WhatsApp, go to Linked devices and scan the code. Prefer to type a code instead of scanning the QR? See Connection.
4. Confirm the connection
Section titled “4. Confirm the connection”curl https://api.zap.nigora.com.br/v1/instances/INSTANCIA_ID \ -H "Authorization: Bearer TOKEN"The response has connectionStatus (disconnected, connecting, qr or connected) and, once connected, the number in phone. If you would rather be notified, set up the instance.connected and instance.disconnected webhooks (see Webhooks).
5. Send your first message
Section titled “5. Send your first message”curl -X POST https://api.zap.nigora.com.br/v1/instances/INSTANCIA_ID/messages/text \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{ "to": "5511999999999", "text": "Olá! Primeira mensagem pela API." }'The response is 202 with { "id": "...", "status": "queued" }. That means the message entered the queue, not that it has been delivered yet. Track the result through webhooks, in the Sending messages guide.
Next steps
Section titled “Next steps”- Authentication: protect your calls with a security token and an IP list.
- Sending media: image, video, audio and document.
- Webhooks: receive messages in your system.