Dashboard Analytics API

Get Consolidated Dashboard Analytics and SMS Statistics

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/read

HTTP Method

POST GET

 

Required Parameters
KeyValueDescription
Login Credentials (Required)
Authenticate your API request using userid-password or apiKey—choose one method.
useridYour Registered UsernameYour registered username; use if apiKey isn't provided. Signup for User ID
passwordYour PasswordURL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key
Header (optional) Parameters
apiKeyYour unique apiKeyapiKey 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.

 

Request Parameters
ParameterTypeRequiredDescription
startDateStringOptionalStart date for analytics (format: YYYY-MM-DD). Default: today
endDateStringOptionalEnd date for analytics (format: YYYY-MM-DD). Default: today. Max range: 31 days
outputStringOptionalResponse format. Use json for JSON response (recommended)
Response Structure

The API returns four main sections of dashboard data:

SectionDescriptionKey Metrics
topBarAccount summary and balance informationBalance, last purchase, groups, contacts, credit type
sentSummaryDaily message statistics for date rangeSubmitted, delivered, failed, pending counts per day
donutInfoOverall status breakdown (for donut/pie charts)Total submitted, delivered, failed, pending, rejected
chartColorsColor configuration for chartsColors for submitted, delivered, failed, pending, rejected
Sample Request Code (Default - Today's Data)
<?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;
}
Sample Request Code (With Date Range)
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"'
Sample Response (Credit User)
{
  "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"
      }
    }
  }
}
Sample Response (Wallet User)
{
  "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": { ... }
    }
  }
}
Sample Response (Reseller Account)
{
  "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

FieldTypeDescription
firstBoxCountString/IntegerFor credit users: "Credit", for wallet users: "Wallet", for resellers: total user count
balanceStringFormatted balance string (e.g., "50000 Credits" or "$250.50")
balanceRawFloatRaw numeric balance value for calculations
balanceCurrencyStringCurrency code for wallet users (e.g., "USD", "EUR"). Empty for credit users
balanceCreditsIntegerBalance converted to SMS credits (0 for credit users if already in credits)
lastPurchaseAmountIntegerAmount of last credit purchase
lastPurchaseDateStringDate/time of last purchase (Y-m-d H:i:s format)
groupsIntegerTotal number of contact groups
contactsIntegerTotal number of contacts in phonebook
creditTypeInteger1 = Credit user, 2 = Wallet user

Sent Summary Fields

FieldTypeDescription
dataArrayDaily statistics array with date, submitted, delivered, failed, pending counts
totalSubmittedIntegerTotal messages submitted in date range
averagePerDayIntegerAverage messages submitted per day in date range
startDateStringStart date of the range (Y-m-d format)
endDateStringEnd date of the range (Y-m-d format)
daysIntegerTotal number of days in the range

Donut Info Fields

FieldTypeDescription
dataArrayArray of status objects with label, value, and labelColor for chart display
labelStringStatus label: Submitted, Delivered, Failed, Pending, Rejected
valueIntegerCount of messages for this status
labelColorStringHex color code for chart visualization (e.g., "#fb9678")

Understanding Credit Types

Credit TypeValueBalance DisplayDescription
Credit User150000 CreditsBalance shown as SMS credits count
Wallet User2$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 creditType to format balance correctly (credits vs currency)
  • Reseller Detection: Use firstBoxCount type 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?

K

Kurlon IT

2022-08-04

We have tied up with other SMS providers also, but SMS GatewayCenter is quite good. Good Service from the team. We are very happy with the service be it accounts related or technical issue. We always get good response.

I

INOX Air Products

2018-02-09

We have an excellent experience with SMS Gateway Center. The services and support has been of very high standard.

S

Shalabh Arora

2025-04-11

I’ve been using SMSGatewayCenter’s bulk SMS and WhatsApp services since early 2022 for my small business, and the experience has been fantastic. The platform is intuitive, and the message delivery is incredibly reliable, reaching my customers without fail. The 24/7 support team is quick to assist, and the cost-effectiveness is a big plus. It’s transformed how I connect with my audience, and I highly recommend it to other entrepreneurs! (Google Revirews)

R

Reflex

2025-04-11

We’ve been using your bulk SMS services for a few months, and the results have been phenomenal. The open rates and customer engagement have gone through the roof. Highly recommend for any business looking to scale fast! (Google Revirews)

V

Vedanth Gowda

2025-04-18

I’m Vedanth Gowda, leading a finance business, and I’ve been leveraging SMSGatewayCenter’s bulk SMS and WhatsApp tools —absolutely transformative! The platform’s speed and precision in delivering financial alerts to my clients are unmatched, giving me a competitive edge. Samrat’s expertise in tailoring notification workflows for market updates was a standout, and the robust security features instilled trust. The affordable pricing and proactive support team make it a no-brainer. Perfect for finance pros aiming to elevate client trust and efficiency! (Google Revirews)

N

Naval Bhatnagar

2025-04-12

From day one, the team at SMS GATEWAY CENTER guided us through setup, testing, and launching campaigns. Their support is A+. Whether you’re new to SMS marketing or experienced, they make it smooth. Thank you Aakash. (Google Revirews)


CTA for Unlock Real-Time Messaging – Integrate Today!

Unlock Real-Time Messaging – Integrate Today!

Try Our API in a Sandbox Environment Before Going Live!

Join Thousands of Developers – Try Our API Now!

Get in touchSign up