Developers
Send Your First Message
Follow this tutorial to send your first message using the Qwetty API.
Prerequisites
- A connected channel (WhatsApp, Instagram, or Web Chat)
- An API key — Create one here
Step 1: List your chats
First, find an existing conversation:
Code
Response:
Code
Step 2: Send a text message
Using a chat ID from the previous step:
Code
Response (the created message under data, plus a message status string):
Code
Step 3: Send a template message
For WhatsApp (outside the 24-hour window), use a template. The endpoint takes a phoneNumber and templateId (not a chat ID):
Code
You can also pass an optional channelId and a templateVariables object for templates with variables.
Step 4: View message history
Fetch messages from a chat:
Code
What's next?
- API Reference — Full endpoint documentation
- Webhooks — Get notified when new messages arrive
- Error Handling — Handle API errors gracefully
Last modified on