OTPStatistics

Get customer's SMS statistics data

Fetch SMS statistics based on customer's sent SMS, filtrated by given parameters. Statistics accumulates SMS and groups them based on given grouping parameters, collecting statistics data for time periods and/or countries. By default, grouping is done by date. Returns data with pagination. For SMS statistics, time period parameters filter by SMS created_at field, not by statistics date itself, so it can be used with country grouping.

GET
/api/v1/sms/statistics

Query Parameters

countries?array<string>

Determines, which countries should be included in the statistics. Accepts a list of country names. If the list is empty, this filtration will be ignored.

group_by?array<>

Determines what data should be used for statistics grouping. In provided an empty list, by default the date grouping will be used.

interval?string

Optional field. Determines the size of time periods for date grouping. If date grouping is selected, and no value is provided for interval, by default the day interval will be used.

Value in"hour" | "day" | "week" | "month"
mcc?array<integer>

It is also possible to determine countries for filtration by their MCC codes. Accepts a list of integers. If the list is empty, this filtration will be ignored.

page?integer

Pagination parameters. Accepts page number. Pagination starts on page=1. If parameter is not provided, the default value of 1 will be set.

page_size?integer

Pagination parameter. Accepts the size of page for pagination. Minimal page size is 1. If parameter is not provided, the default value of 10 will be set.

period_end?string

Time period filter, determines the end of the period. Accepts string with time either as UNIX timestamp, or in format 2006-01-02T15:04:05Z07:00.

period_start?string

Time period filter, determines the start of the period. Accepts string with time either as UNIX timestamp, or in format 2006-01-02T15:04:05Z07:00.

price_from?number

Optional parameter. Allows to filter out only statistic entities with total price greater than provided value.

Range0 <= value
price_to?number

Optional parameter. Allows to filter out only statistic entities with total price less than provided value.

Range0 <= value
sort_by?string

Ordering parameter. Defines by which field the data will be sorted. If parameter is not provided, will be used entity's default ordering. To use entity's default sorting, pass _default as value.

Value in"country" | "date" | "sent" | "count" | "delivered" | "not_delivered" | "expired" | "pending" | "total_price" | "sent_to_delivered" | "delivery_rate_percent"
sort_order?string

Ordering parameter. Defines the order of sorting (asc or desc). If parameter is not provided, will be used entity's default ordering.

Value in"asc" | "desc"

Header Parameters

Authorization*string

Your API token

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://dev-refactor-api-e.voipenv.uk/api/v1/sms/statistics" \  -H "Authorization: string"
{
  "data": [
    {
      "count": 0,
      "country": "string",
      "date": "string",
      "delivered": 0,
      "delivery_rate_percent": 0,
      "expired": 0,
      "mcc": 0,
      "not_delivered": 0,
      "pending": 0,
      "total_price": 0
    }
  ],
  "page": 0,
  "page_size": 0,
  "total": 0,
  "total_pages": 0
}
{
  "code": 0,
  "error_details": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "message": "string",
  "request_id": "string",
  "status": "error"
}
{
  "code": 0,
  "error_details": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "message": "string",
  "request_id": "string",
  "status": "error"
}
{
  "code": 0,
  "error_details": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "message": "string",
  "request_id": "string",
  "status": "error"
}
Form Call To Action

Contact us

You can always send us a message or email. Weʼd be happy to help you out.