1. Home
  2. Gateway
  3. HTTP Api
  4. Analytics

Analytics

Get detailed statistics of your account directly through our API.

Please send your request to the following URL:

https://gateway.sms77.io/api/analytics

Optional parameters

In addition to the data for authentication, the following parameters can be specified:

.

Parametersdescription Possible values
startStart date of the statistics in the format YYYY-MM-DD. By default, the date of 30 days ago is set.2020-01-01
endend date of the statistics. By default, the current day.2020-05-30
labelShows only data of a specific label.all – Shows all data, default.
customer_label1
customer_label2
subaccountsReceive the data only for the main account, all your (sub-)accounts or only for specific subaccountsonly_main – Only data of the main account, default.
all – Data of all accounts
9123456 – Subaccount ID
group_byDefines the grouping of the datadate – default
label
subaccount
country

Return

The results are returned formatted as JSON.

Example 1

Query the statistics of the last 30 days.

Request
https://gateway.sms77.io/api/analytics?p=api-key

Response

[
    {
        "date": "2020-05-13"
        "economy": 1,
        "direct": 2,
        "voice": 0,
        "hlr": 0,
        "mnp": 0,
        "inbound": 72,
        "usage_eur": 0.208
    },
    {
        "date": "2020-05-14"
        "economy": 1,
        "direct": 6,
        "voice": 0,
        "hlr": 0,
        "mnp": 0,
        "inbound": 72,
        "usage_eur": 0.508
    },
    {
        "date": "2020-05-15"
        "economy": 1,
        "direct": 38,
        "voice": 0,
        "hlr": 0,
        "mnp": 0,
        "inbound": 72,
        "usage_eur": 2,908
    },
    {
        "date": "2020-05-16"
        "economy": 1,
        "direct": 2,
        "voice": 0,
        "hlr": 0,
        "mnp": 0,
        "inbound": 72,
        "usage_eur": 0.208
    },
    ...
]

Example 2

Query the statistics of 2019, grouped by destination country. You will receive as country the ISO 3166-1 alpha-2 code of the respective country. If this code is empty, it is an unidentifiable country.

Request
https://gateway.sms77.io/api/analytics?p=api-key&start=2019-01-01&end=2019-12-31&group_by=country

Response

[
    {
        "country": "DE",
        "economy": 374,
        "direct": 149046,
        "voice": 19,
        "hlr": 333,
        "mnp": 167,
        "inbound": 43744,
        "usage_eur": 11204.0564
    },
    {
        "country": ""
        "economy": 0,
        "direct": 0,
        "voice": 0,
        "hlr": 572,
        "mnp": 29,
        "inbound": 0,
        "usage_eur": 5,8725
    },
    {
        "country": "LI",
        "economy": 2,
        "direct": 15,
        "voice": 0,
        "hlr": 6,
        "mnp": 12,
        "inbound": 0,
        "usage_eur": 1,331
    },
    {
        "country": "US",
        "economy": 0,
        "direct": 10,
        "voice": 0,
        "hlr": 2,
        "mnp": 0,
        "inbound": 4,
        "usage_eur": 0.8
    },
    {
        "country": "PL",
        "economy": 0,
        "direct": 8,
        "voice": 0,
        "hlr": 0,
        "mnp": 0,
        "inbound": 8,
        "usage_eur": 0.6
    }
]
Was this article helpful to you? Yes No
Menu