Get Campaign
GET /api/cc/campaigns/:id
One campaign, its numbers counted by status, and the total charged so far. Poll it to show progress.
Requires a Bearer API token (from Authentication / dashboard API Tokens) and the call-center permission.
Rate limit: 60 requests per minute per account, shared by all Campaign API endpoints.
Request Example
Section titled “Request Example”curl -X GET https://api.awajdigital.com/api/cc/campaigns/42 \ -H "Authorization: Bearer your_api_token_here" \ -H "Accept: application/json"// Browser JavaScript (Fetch API)const response = await fetch('https://api.awajdigital.com/api/cc/campaigns/42', { method: 'GET', headers: { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' }});
const data = await response.json();console.log(data);// Node.js with axiosconst axios = require('axios');
async function getCampaign() { try { const response = await axios.get('https://api.awajdigital.com/api/cc/campaigns/42', { headers: { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' } });
console.log(response.data); } catch (error) { console.error('Error:', error.response?.data || error.message); }}
getCampaign();# Python with requestsimport requests
def get_campaign(): url = 'https://api.awajdigital.com/api/cc/campaigns/42' headers = { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' }
try: response = requests.get(url, headers=headers) print(response.json()) except requests.exceptions.RequestException as e: print(f'Error: {e}')
get_campaign()<?php// PHP with cURL$url = 'https://api.awajdigital.com/api/cc/campaigns/42';$token = 'your_api_token_here';
$ch = curl_init($url);curl_setopt($ch, CURLOPT_HTTPGET, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer ' . $token, 'Accept: application/json']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl_close($ch);
$result = json_decode($response, true);print_r($result);?>Success Response Example
Section titled “Success Response Example”{ "data": { "id": 42, "name": "October renewals", "status": "running", "group_id": 7, "group_name": "Sales", "contact_count": 197, "customer_ring_seconds": 30, "max_customer_wait_seconds": 20, "started_at": "2026-10-21T10:05:00.000+06:00", "stopped_at": null, "created_at": "2026-10-21T10:00:00.000+06:00", "contacts": { "pending": 120, "queued": 8, "done": 64, "failed": 5, "cancelled": 0 }, "total_charge": 31.5 }}The campaign fields are described in Create Campaign. In addition:
| Field | Type | Description |
|---|---|---|
| contacts.pending | integer | Waiting to be called, or waiting for a retry |
| contacts.queued | integer | Being called now |
| contacts.done | integer | Finished: answered and connected to an agent, or rejected by the customer |
| contacts.failed | integer | Out of attempts |
| contacts.cancelled | integer | Never called because the campaign was stopped |
| total_charge | number | Taka charged for this campaign’s calls so far |
Error Responses
Section titled “Error Responses”| Status | Code | Description |
|---|---|---|
| 401 | — | Missing or invalid access token |
| 403 | — | Account does not have the call-center permission |
| 404 | campaign_not_found |
Unknown campaign, or not on your account |
| 429 | — | Rate limit exceeded (60 requests/minute) |
