List Broadcasts
GET /api/broadcasts
Retrieve a list of all broadcasts created by the authenticated user. By default, returns broadcasts from the last 30 days. You can specify a custom date range (maximum 90 days).
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| start_date | string | No | Start date in ISO 8601 format (e.g., 2025-01-01). Defaults to 30 days ago. |
| end_date | string | No | End date in ISO 8601 format (e.g., 2025-01-31). Defaults to today. |
Request Examples
Section titled “Request Examples”Default (last 30 days):
curl -X GET https://api.awajdigital.com/api/broadcasts \ -H "Authorization: Bearer your_api_token_here" \ -H "Accept: application/json"With a custom date range:
curl -X GET "https://api.awajdigital.com/api/broadcasts?start_date=2025-01-01&end_date=2025-01-31" \ -H "Authorization: Bearer your_api_token_here" \ -H "Accept: application/json"// Browser JavaScript (Fetch API)const response = await fetch('https://api.awajdigital.com/api/broadcasts', { 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 getBroadcasts() { try { const response = await axios.get('https://api.awajdigital.com/api/broadcasts', { headers: { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' } });
console.log(response.data); } catch (error) { console.error('Error:', error.response?.data || error.message); }}
getBroadcasts();# Python with requestsimport requests
def get_broadcasts(): url = 'https://api.awajdigital.com/api/broadcasts' 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_broadcasts()<?php// PHP with cURL$url = 'https://api.awajdigital.com/api/broadcasts';$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”{ "success": true, "broadcasts": [ { "id": 123, "name": "api_1_voice_100", "status": "completed", "createdAt": "2025-01-15T10:30:00.000+06:00" }, { "id": 124, "name": "api_1_voice_50", "status": "broadcasting", "createdAt": "2025-01-14T14:20:00.000+06:00" } ], "dateRange": { "startDate": "2025-01-01", "endDate": "2025-01-31" }}400 Bad Request - Date Range Too Large
Section titled “400 Bad Request - Date Range Too Large”Date range exceeds 90 days:
{ "success": false, "message": "Date range cannot exceed 90 days"}