Channels
Retrieve information about your connected messaging channels. Channels represent your WhatsApp Business accounts and other messaging integrations.
List channels
Section titled “List channels” GET
/channels Get all channels accessible with your API key.
curl \ https://app.dutiesbook.com/api/external/v1/channels \ -H "X-Account-Id: acc_xxxxxxxx" \ -H "X-Api-Key: pk_xxxxxxxxxxxxxxxx" \ -H "X-Secret-Key: sk_xxxxxxxxxxxxxxxx"// Node.js 18 or later (built-in fetch)const response = await fetch('https://app.dutiesbook.com/api/external/v1/channels', { method: 'GET', headers: { 'X-Account-Id': process.env.DUTIES_ACCOUNT_ID, 'X-Api-Key': process.env.DUTIES_API_KEY, 'X-Secret-Key': process.env.DUTIES_SECRET_KEY, },});
const result = await response.json();import osimport requests
response = requests.get( "https://app.dutiesbook.com/api/external/v1/channels", headers={ "X-Account-Id": os.environ["DUTIES_ACCOUNT_ID"], "X-Api-Key": os.environ["DUTIES_API_KEY"], "X-Secret-Key": os.environ["DUTIES_SECRET_KEY"], },)
result = response.json(){ "success": true, "data": { "channels": [ { "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name": "Channel Name", "type": "whatsapp", "status": "connected", "phoneNumber": "+xxxxxxxxxxx", "businessName": "Business Name", "workingHours": { "enabled": false, "timezone": "UTC" }, "createdAt": "2024-01-01T00:00:00.000Z", "updatedAt": "2024-01-01T00:00:00.000Z" } ], "total": 1 }}Get channel
Section titled “Get channel” GET
/channels/{channelId} Get details for a specific channel including business information and working hours.
Path parameters
Section titled “Path parameters”channelId string Required Channel UUID
curl \ https://app.dutiesbook.com/api/external/v1/channels/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \ -H "X-Account-Id: acc_xxxxxxxx" \ -H "X-Api-Key: pk_xxxxxxxxxxxxxxxx" \ -H "X-Secret-Key: sk_xxxxxxxxxxxxxxxx"// Node.js 18 or later (built-in fetch)const response = await fetch('https://app.dutiesbook.com/api/external/v1/channels/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', { method: 'GET', headers: { 'X-Account-Id': process.env.DUTIES_ACCOUNT_ID, 'X-Api-Key': process.env.DUTIES_API_KEY, 'X-Secret-Key': process.env.DUTIES_SECRET_KEY, },});
const result = await response.json();import osimport requests
response = requests.get( "https://app.dutiesbook.com/api/external/v1/channels/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", headers={ "X-Account-Id": os.environ["DUTIES_ACCOUNT_ID"], "X-Api-Key": os.environ["DUTIES_API_KEY"], "X-Secret-Key": os.environ["DUTIES_SECRET_KEY"], },)
result = response.json(){ "success": true, "data": { "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "name": "Channel Name", "type": "whatsapp", "status": "connected", "phoneNumber": "+xxxxxxxxxxx", "businessName": "Business Name", "workingHours": { "enabled": false, "timezone": "UTC" }, "createdAt": "2024-01-01T00:00:00.000Z", "updatedAt": "2024-01-01T00:00:00.000Z" }}Errors
Section titled “Errors”RES_001 404 CHANNEL_NOT_FOUND
The specified channel was not found or you don't have access to it.
AUTH_008 403 CHANNEL_ACCESS_DENIED
This API key is restricted to specific channels and does not have access to this channel.
BIZ_001 422 CHANNEL_NOT_CONNECTED
The channel exists but is not currently connected. Check the channel status in your dashboard.