Check Balance
GET /api/balance
Retrieve the current account balance for the authenticated user. This endpoint returns the available balance that can be used for broadcasts and surveys.
Request Example
Section titled “Request Example”curl -X GET https://api.awajdigital.com/api/balance \ -H "Authorization: Bearer your_api_token_here" \ -H "Accept: application/json"// Browser JavaScript (Fetch API)const response = await fetch('https://api.awajdigital.com/api/balance', { 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 getBalance() { try { const response = await axios.get('https://api.awajdigital.com/api/balance', { headers: { 'Authorization': 'Bearer your_api_token_here', 'Accept': 'application/json' } });
console.log(response.data); } catch (error) { console.error('Error:', error.response?.data || error.message); }}
getBalance();# Python with requestsimport requests
def get_balance(): url = 'https://api.awajdigital.com/api/balance' 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_balance()<?php// PHP with cURL$url = 'https://api.awajdigital.com/api/balance';$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, "balance": 1250.75}