Examples
Response examples
The following example demonstrates a Metrics API response, providing structured data on message traffic. This response includes channel-specific metrics, timestamps, delivery statuses, and engagement details, offering a clear view of communication performance
The JSON structure consists of a top-level object with three main keys:
requestId
: It uniquely identifies the request.status
: Indicates whether the request was successful or not.response
: Contains the actual data returned by the query.
Within the response
object, there are several key pieces of information:
requestedPeriod
: A parameter that specifies the time period for which the data was requested, typically denoted by a start and end timestamp.totalRows
: A parameter that indicates the total number of rows returned in the response.columns
: An array that provides information about the structure of the data, including the names and data types of each column.rows
: An array thatcontains the actual data returned by the query. Each row represents a single communication instance, with values corresponding to the columns specified in thecolumns
array.
In the provided example, there are six rows of data, each representing a communication event. The data includes details such as the channel code, timestamp, status group, status, communication count, traffic counts, delivery rates, and open rates. Some values may be shown as N/A, indicating unavailable data.
Sum of message counts
This query retrieves the sum of SMS messages sent over the past day, aggregated per hour. It provides an overview of message traffic trends, helping you analyze delivery performance and failure rates.
Sample request body
Sample result
The response provides a summary of SMS message traffic for the requested period. It includes details such as the total number of messages, how many were successfully delivered, and how many failed.
Result breakdown
The following table summarizes the response data, showing the SMS traffic details for the given timestamp.
Metric | Value |
---|---|
CHANNEL_CODE | SMS |
HOUR | 2024-03-19T11:00:00.000Z |
TOTAL_TRAFFIC_COUNT | 17 |
TOTAL_SENT_TRAFFIC_COUNT | 17 |
DELIVERED_TRAFFIC_COUNT | 16 |
FAILED_TRAFFIC_COUNT | 1 |
Aggregating by application ID and entity ID
This query retrieves message traffic data grouped by application ID and entity ID, allowing you to analyze traffic distribution across different applications and brands. This can help measure the performance of campaigns, notifications, and different communication channels.
Sample request body
The following request filters messages sent within a specified time range and aggregates the data by application ID and entity ID. The response includes key metrics such as total traffic, sent messages, delivered messages, and the delivery rate.
Sample result
The response returns aggregated data for each application ID and entity ID, showing message distribution across different brands and communication channels.
Result breakdown
The table below summarizes the aggregated message traffic based on application ID and entity ID, showing total messages, sent messages, deliveries, and delivery rates across multiple brands and channels.
CHANNEL_CODE | SMS | SMS | SMS | SMS | VIBER | VIBER | |
---|---|---|---|---|---|---|---|
APPLICATION_ID | PROMOTION | PROMOTION | NOTIFICATION | NOTIFICATION | PROMOTION | PROMOTION | PROMOTION |
ENTITY_ID | BrandA | BrandB | BrandA | BrandB | BrandA | BrandB | BrandB |
TOTAL_TRAFFIC_COUNT | 250 | 500 | 100 | 420 | 200 | 350 | 800 |
TOTAL_SENT_TRAFFIC_COUNT | 230 | 480 | 91 | 390 | 191 | 299 | 499 |
>DELIVERED_TRAFFIC_COUNT | 210 | 430 | 85 | 370 | 180 | 280 | 450 |
TRAFFIC_DELIVERY_RATE (%) | 91.30 | 89.58 | 93.41 | 94.87 | 94.24 | 93.65 | 90.28 |