Quick start
Send your first WhatsApp template message in three simple steps.
Prerequisites
Section titled “Prerequisites”Before you begin
- An active DutiesBook account
- A connected WhatsApp Business channel
- At least one approved message template
Step 1: Create API credentials
Section titled “Step 1: Create API credentials”Log in to dashboard
Access your account dashboard at your organization’s portal.
Navigate to API keys
Go to Organization → API Key
Create new key
Click Create API Key and name it (e.g., “Production Backend”)
Set permissions
Enable:
readChannels, readTemplates, sendSingleMessages, sendBulkMessages Save credentials
Copy your Account ID (
acc_…), API Key (pk_…), and Secret Key (sk_…) Important
Store your Secret Key securely. It cannot be retrieved after creation.
Step 2: Verify your credentials
Section titled “Step 2: Verify your credentials” POST
/auth/verify Test that your credentials work:
curl -X POST https://app.dutiesbook.com/api/external/v1/auth/verify \ -H "X-Account-Id: acc_12345678" \ -H "X-Api-Key: pk_abcdefghij" \ -H "X-Secret-Key: sk_1234567890abcdef"Success response
Section titled “Success response”{ "success": true, "data": { "valid": true, "organization": { "uuid": "org-uuid", "name": "Your Organization" }, "apiKey": { "name": "Production Backend", "accessType": "all_ips", "createdAt": "2024-01-15T10:00:00Z" } }}Step 3: Send your first message
Section titled “Step 3: Send your first message”3.1 List your channels
Section titled “3.1 List your channels” GET
/channels curl https://app.dutiesbook.com/api/external/v1/channels \ -H "X-Account-Id: acc_12345678" \ -H "X-Api-Key: pk_abcdefghij" \ -H "X-Secret-Key: sk_1234567890abcdef"Note
Copy the uuid of your WhatsApp channel from the response.
3.2 List available templates
Section titled “3.2 List available templates” GET
/channels/:channelId/templates curl "https://app.dutiesbook.com/api/external/v1/channels/CHANNEL_UUID/templates?status=APPROVED" \ -H "X-Account-Id: acc_12345678" \ -H "X-Api-Key: pk_abcdefghij" \ -H "X-Secret-Key: sk_1234567890abcdef"Note
Copy the name and language of the template you want to use.
3.3 Send a message
Section titled “3.3 Send a message” POST
/messages/send curl -X POST https://app.dutiesbook.com/api/external/v1/messages/send \ -H "Content-Type: application/json" \ -H "X-Account-Id: acc_12345678" \ -H "X-Api-Key: pk_abcdefghij" \ -H "X-Secret-Key: sk_1234567890abcdef" \ -d '{ "channelId": "CHANNEL_UUID", "to": "+1234567890", "templateName": "hello_world", "language": "en_US", "variables": { "body": { "1": "John" } } }'Success response
Section titled “Success response”{ "success": true, "data": { "messageId": "wamid.HBgLMTIzNDU2Nzg5MA==", "status": "sent", "to": "+1234567890", "templateName": "hello_world", "sentAt": "2024-01-15T10:30:00Z" }}Congratulations!
You’ve sent your first message using the External API!