Metrics API
Examples

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 the columns 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.

MetricValue
CHANNEL_CODESMS
HOUR2024-03-19T11:00:00.000Z
TOTAL_TRAFFIC_COUNT17
TOTAL_SENT_TRAFFIC_COUNT17
DELIVERED_TRAFFIC_COUNT16
FAILED_TRAFFIC_COUNT1

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_CODESMSSMSSMSSMSVIBERVIBERWHATSAPP
APPLICATION_IDPROMOTIONPROMOTIONNOTIFICATIONNOTIFICATIONPROMOTIONPROMOTIONPROMOTION
ENTITY_IDBrandABrandBBrandABrandBBrandABrandBBrandB
TOTAL_TRAFFIC_COUNT250500100420200350800
TOTAL_SENT_TRAFFIC_COUNT23048091390191299499
>DELIVERED_TRAFFIC_COUNT21043085370180280450
TRAFFIC_DELIVERY_RATE (%)91.3089.5893.4194.8794.2493.6590.28

Need assistance

Explore Infobip Tutorials

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Service Terms & ConditionsPrivacy policyTerms of use