Dashboard Analytics API
Introduction to Dashboard Analytics API
Welcome to SMSGatewayCenter's Dashboard Analytics API! This powerful API provides consolidated dashboard data for mobile applications, delivering comprehensive SMS statistics, account balance, message delivery analytics, and real-time insights. Perfect for building mobile dashboards that display account overview, sent message summaries, delivery reports with status breakdowns, and visual charts. Our RESTful endpoint supports POST and GET methods over HTTP for flexible integration.
About Dashboard Analytics API
The Dashboard Analytics API enables you to:
- View account balance - Get SMS credits or wallet balance with currency
- Track last purchase - View most recent credit purchase details
- Count resources - Get total groups and contacts count
- View sent statistics - Daily message stats with date range filtering
- Delivery breakdown - Status-wise message analysis (submitted, delivered, failed, pending, rejected)
- Visual chart data - Get chart colors for consistent UI display
- Reseller insights - Additional analytics for reseller accounts
- Date range filtering - Analyze data for specific date ranges (up to 31 days)
All data is automatically filtered based on account type and provides reseller-specific insights when applicable.
Key Features
- Consolidated Data: Single API call returns all dashboard metrics
- Real-time Balance: Shows current SMS credits or wallet balance
- Date Range Support: Filter statistics by custom date ranges
- Status Breakdown: Detailed message status analytics (donut chart data)
- Average Calculations: Automatic daily average computations
- Reseller Support: Special metrics for reseller accounts (user counts)
- Chart-Ready: Pre-formatted data with colors for direct chart integration
Read Dashboard Analytics
Retrieve consolidated dashboard data including account summary, message statistics, and delivery analytics for the specified date range.
API Endpoint
https://unify.smsgateway.center/SMSApi/dashboard/readHTTP Method
POST GET
| Key | Value | Description |
|---|---|---|
| Login Credentials (Required) | ||
| Authenticate your API request using userid-password or apiKey—choose one method. | ||
| userid | Your Registered Username | Your registered username; use if apiKey isn't provided. Signup for User ID |
| password | Your Password | URL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key |
| Header (optional) Parameters | ||
| apiKey | Your unique apiKey | apiKey needs to be sent as HTTP header when you are not using userid-password method. You can avail this from your user control panel and use instead of userid-password HTTP Request parameter. Please do not disclose this to anyone. |
| Parameter | Type | Required | Description |
|---|---|---|---|
startDate | String | Optional | Start date for analytics (format: YYYY-MM-DD). Default: today |
endDate | String | Optional | End date for analytics (format: YYYY-MM-DD). Default: today. Max range: 31 days |
output | String | Optional | Response format. Use json for JSON response (recommended) |
The API returns four main sections of dashboard data:
| Section | Description | Key Metrics |
|---|---|---|
topBar | Account summary and balance information | Balance, last purchase, groups, contacts, credit type |
sentSummary | Daily message statistics for date range | Submitted, delivered, failed, pending counts per day |
donutInfo | Overall status breakdown (for donut/pie charts) | Total submitted, delivered, failed, pending, rejected |
chartColors | Color configuration for charts | Colors for submitted, delivered, failed, pending, rejected |
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://unify.smsgateway.center/SMSApi/dashboard/read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "userid=YourUsername&password=YourPassword&output=json",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl --location 'https://unify.smsgateway.center/SMSApi/dashboard/read' \
--form 'userid="YourUsername"' \
--form 'password="YourPassword"' \
--form 'startDate="2025-12-01"' \
--form 'endDate="2025-12-04"' \
--form 'output="json"'{
"response": {
"api": "dashboard",
"action": "read",
"status": "success",
"msg": "success",
"code": 200,
"count": 4,
"dashboard": {
"topBar": {
"firstBoxCount": "Credit",
"balance": "50000 Credits",
"balanceRaw": 50000,
"balanceCurrency": "",
"balanceCredits": 50000,
"lastPurchaseAmount": 10000,
"lastPurchaseDate": "2025-11-25 14:30:00",
"groups": 15,
"contacts": 1250,
"creditType": 1
},
"sentSummary": {
"data": [
{
"date": "2025-12-01",
"dateFormatted": "Dec 01",
"submitted": 5000,
"delivered": 4850,
"failed": 100,
"pending": 50
},
{
"date": "2025-12-02",
"dateFormatted": "Dec 02",
"submitted": 3500,
"delivered": 3400,
"failed": 80,
"pending": 20
},
{
"date": "2025-12-03",
"dateFormatted": "Dec 03",
"submitted": 4200,
"delivered": 4100,
"failed": 90,
"pending": 10
},
{
"date": "2025-12-04",
"dateFormatted": "Dec 04",
"submitted": 2800,
"delivered": 2750,
"failed": 40,
"pending": 10
}
],
"totalSubmitted": 15500,
"averagePerDay": 3875,
"startDate": "2025-12-01",
"endDate": "2025-12-04",
"days": 4
},
"donutInfo": {
"data": [
{
"label": "Submitted",
"value": 15500,
"labelColor": "#fb9678"
},
{
"label": "Delivered",
"value": 15100,
"labelColor": "#01c0c8"
},
{
"label": "Failed",
"value": 310,
"labelColor": "#DE1F95"
},
{
"label": "Pending",
"value": 90,
"labelColor": "#0B62A4"
},
{
"label": "Rejected",
"value": 0,
"labelColor": "#4f5467"
}
],
"startDate": "2025-12-01",
"endDate": "2025-12-04"
},
"chartColors": {
"submitted": "#fb9678",
"delivered": "#01c0c8",
"failed": "#DE1F95",
"pending": "#0B62A4",
"rejected": "#4f5467"
}
}
}
}
{
"response": {
"api": "dashboard",
"action": "read",
"status": "success",
"msg": "success",
"code": 200,
"count": 4,
"dashboard": {
"topBar": {
"firstBoxCount": "Wallet",
"balance": "$250.50",
"balanceRaw": 250.5,
"balanceCurrency": "USD",
"balanceCredits": 50100,
"lastPurchaseAmount": 100,
"lastPurchaseDate": "2025-11-30 10:15:00",
"groups": 8,
"contacts": 650,
"creditType": 2
},
"sentSummary": { ... },
"donutInfo": { ... },
"chartColors": { ... }
}
}
}
{
"response": {
"api": "dashboard",
"action": "read",
"status": "success",
"msg": "success",
"code": 200,
"count": 4,
"dashboard": {
"topBar": {
"firstBoxCount": "45",
"balance": "$1500.00",
"balanceRaw": 1500,
"balanceCurrency": "USD",
"balanceCredits": 300000,
"lastPurchaseAmount": 500,
"lastPurchaseDate": "2025-12-01 09:00:00",
"groups": 25,
"contacts": 5000,
"creditType": 2
},
"sentSummary": { ... },
"donutInfo": { ... },
"chartColors": { ... }
}
}
}
Note: For reseller accounts, firstBoxCount shows the total number of users under the reseller instead of "Credit" or "Wallet".
Response Fields Explained
Top Bar Fields
| Field | Type | Description |
|---|---|---|
firstBoxCount | String/Integer | For credit users: "Credit", for wallet users: "Wallet", for resellers: total user count |
balance | String | Formatted balance string (e.g., "50000 Credits" or "$250.50") |
balanceRaw | Float | Raw numeric balance value for calculations |
balanceCurrency | String | Currency code for wallet users (e.g., "USD", "EUR"). Empty for credit users |
balanceCredits | Integer | Balance converted to SMS credits (0 for credit users if already in credits) |
lastPurchaseAmount | Integer | Amount of last credit purchase |
lastPurchaseDate | String | Date/time of last purchase (Y-m-d H:i:s format) |
groups | Integer | Total number of contact groups |
contacts | Integer | Total number of contacts in phonebook |
creditType | Integer | 1 = Credit user, 2 = Wallet user |
Sent Summary Fields
| Field | Type | Description |
|---|---|---|
data | Array | Daily statistics array with date, submitted, delivered, failed, pending counts |
totalSubmitted | Integer | Total messages submitted in date range |
averagePerDay | Integer | Average messages submitted per day in date range |
startDate | String | Start date of the range (Y-m-d format) |
endDate | String | End date of the range (Y-m-d format) |
days | Integer | Total number of days in the range |
Donut Info Fields
| Field | Type | Description |
|---|---|---|
data | Array | Array of status objects with label, value, and labelColor for chart display |
label | String | Status label: Submitted, Delivered, Failed, Pending, Rejected |
value | Integer | Count of messages for this status |
labelColor | String | Hex color code for chart visualization (e.g., "#fb9678") |
Understanding Credit Types
| Credit Type | Value | Balance Display | Description |
|---|---|---|---|
| Credit User | 1 | 50000 Credits | Balance shown as SMS credits count |
| Wallet User | 2 | $250.50 (≈ 50100 Credits) | Balance shown as currency amount with optional credit conversion |
Integration Examples
Example 1: Display Dashboard in Mobile App
// React Native / JavaScript example
async function loadDashboard() {
const formData = new FormData();
formData.append('userid', 'YourUsername');
formData.append('password', 'YourPassword');
formData.append('output', 'json');
try {
const response = await fetch('https://unify.smsgateway.center/SMSApi/dashboard/read', {
method: 'POST',
body: formData
});
const data = await response.json();
if (data.response.status === 'success') {
const dashboard = data.response.dashboard;
// Display top bar
console.log(`Balance: ${dashboard.topBar.balance}`);
console.log(`Groups: ${dashboard.topBar.groups}`);
console.log(`Contacts: ${dashboard.topBar.contacts}`);
// Display sent summary
console.log(`Total Sent: ${dashboard.sentSummary.totalSubmitted}`);
console.log(`Average/Day: ${dashboard.sentSummary.averagePerDay}`);
// Display donut chart data
dashboard.donutInfo.data.forEach(item => {
console.log(`${item.label}: ${item.value}`);
});
return dashboard;
}
} catch (error) {
console.error('Error loading dashboard:', error);
}
}
loadDashboard();Example 2: Get Analytics for Date Range
import requests
from datetime import datetime, timedelta
def get_dashboard_analytics(days_back=7):
end_date = datetime.now()
start_date = end_date - timedelta(days=days_back)
url = 'https://unify.smsgateway.center/SMSApi/dashboard/read'
data = {
'userid': 'YourUsername',
'password': 'YourPassword',
'startDate': start_date.strftime('%Y-%m-%d'),
'endDate': end_date.strftime('%Y-%m-%d'),
'output': 'json'
}
response = requests.post(url, data=data)
result = response.json()
if result['response']['status'] == 'success':
dashboard = result['response']['dashboard']
print(f"Analytics for {days_back} days:")
print(f"Total Submitted: {dashboard['sentSummary']['totalSubmitted']}")
print(f"Average Per Day: {dashboard['sentSummary']['averagePerDay']}")
# Daily breakdown
print("\nDaily Statistics:")
for day in dashboard['sentSummary']['data']:
print(f"{day['dateFormatted']}: {day['submitted']} sent, {day['delivered']} delivered")
return dashboard
else:
print(f"Error: {result['response']['msg']}")
# Get last 7 days analytics
get_dashboard_analytics(7)Example 3: Build Donut Chart
<?php
function getDashboardDonutData() {
$url = "https://unify.smsgateway.center/SMSApi/dashboard/read";
$postData = array(
'userid' => 'YourUsername',
'password' => 'YourPassword',
'output' => 'json'
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if ($data['response']['status'] === 'success') {
$donutInfo = $data['response']['dashboard']['donutInfo'];
// Prepare data for chart library
$chartData = array(
'labels' => array(),
'values' => array(),
'colors' => array()
);
foreach ($donutInfo['data'] as $item) {
$chartData['labels'][] = $item['label'];
$chartData['values'][] = $item['value'];
$chartData['colors'][] = $item['labelColor'];
}
return $chartData;
}
return null;
}
// Usage
$donutData = getDashboardDonutData();
echo json_encode($donutData);
Example 4: Monthly Report Generation
# Get current month analytics
START_DATE=$(date +"%Y-%m-01")
END_DATE=$(date +"%Y-%m-%d")
curl --location 'https://unify.smsgateway.center/SMSApi/dashboard/read' \
--form "userid=\"YourUsername\"" \
--form "password=\"YourPassword\"" \
--form "startDate=\"$START_DATE\"" \
--form "endDate=\"$END_DATE\"" \
--form "output=\"json\"" | jq '.response.dashboard'Best Practices
Recommendations
- Date Range Limits: Maximum 31 days per request to ensure optimal performance
- Default Today: If no date parameters provided, API defaults to today's data
- Cache Strategy: Cache dashboard data for 5-10 minutes to reduce API calls
- Chart Integration: Use provided colors for consistent UI across platforms
- Balance Display: Check
creditTypeto format balance correctly (credits vs currency) - Reseller Detection: Use
firstBoxCounttype to identify reseller accounts - Error Handling: Implement proper error handling for date validation errors
- Responsive UI: Design dashboard to handle both small and large data ranges
- Zero Data: Handle cases where no messages sent in date range gracefully
- Real-time Updates: Refresh dashboard data periodically for real-time insights
Common Use Cases
Mobile Dashboard
Build comprehensive mobile dashboards with real-time SMS statistics and account overview.
Analytics Charts
Create visual charts (line, bar, donut) with pre-formatted data and colors.
Period Reports
Generate daily, weekly, or monthly SMS usage reports with delivery statistics.
Balance Monitoring
Track account balance and last purchase for proactive credit management.
Date Range Validation
Important Date Rules
- Format: Date must be in YYYY-MM-DD format (e.g., 2025-12-04)
- Maximum Range: Date range cannot exceed 31 days (one month)
- End Date: End date must be equal to or after start date
- Default Behavior: If dates omitted, API returns today's data only
- Invalid Dates: API returns validation error for malformed dates
Testimonials
Why do Great Businesses Trust SMS Gateway Center?

