Traffic Report API v2

1. Introduction

The HORISEN Traffic Report API is used for bulk traffic reports.

This API returns information about the traffic, the number of sent messages, the price per message and the total amount for each pricing condition, country, operator and selling/buying price.

This API belongs to the Traffic Report domain. The subject domain of an endpoint URL is:

https://api{separator}{platform_domain}/bulk/traffic-report/v2

Note: A domain is presented with placeholders as https://api{separator}{platform_domain}, where {separator} can be a dot (.) or a hyphen (-). Please, replace it with your actual platform domain name.

The API uses the HORISEN implementation of the OAuth 2.0 protocol. For more information, please refer to the OAuth2 Authentication Guidelines page.

1.1 API Call Examples

The following API call samples demonstrate some use cases of how to retrieve data within Overall Traffic Reports for a period of time, by using grain, embed, groupBy and sort parameters. Please note, you have to replace a domain with your actual platform domain name, and the ACCESS_TOKEN value with a valid token.

1. An example of how to get an Overall Traffic Report for a period of time, by hour (grain=hour), returning country and number of messages, grouped by country:

curl -X GET --header "Authorization: Bearer ACCESS_TOKEN" "https://api{separator}{platform_domain}/bulk/traffic-report/v2/overall-traffic-reports?startDt=2024-10-01T00:00:00%2d02:00&endDt=2024-10-03T00:00:00%2d02:00&grain=hour&embed=countryName,inSmsCnt&groupBy=countryName"

2. The API call example to get an Overall Traffic Report for a period of time, with day value for data granularity, returning country, date and number of messages, grouped by country and date, sorted by country name and date:

curl -X GET --header "Authorization: Bearer ACCESS_TOKEN" "https://api{separator}{platform_domain}/bulk/traffic-report/v2/overall-traffic-reports?startDt=2024-11-01T00:00:00Z&endDt=2024-11-15T00:00:00Z&grain=day&embed=countryName,msgDate,inSmsCnt&groupBy=countryName,msgDate&sort=countryName,msgDate"

3. An example of how to get an Overall Traffic Report for a period of time, by day (grain=day), returning date, customer, selling price, selling currency, supplier, buying price, buying currency and number of messages for customer and supplier, grouped by date, customer, selling price, selling currency, supplier, buying price and buying currency:

curl -X GET --header "Authorization: Bearer ACCESS_TOKEN" "https://api{separator}{platform_domain}/bulk/traffic-report/v2/overall-traffic-reports?startDt=2024-10-15T00:00:00%2d02:00&endDt=2024-10-31T00:00:00%2d02:00&grain=day&embed=msgDate,customerBriefName,sellPrice,sellCurrencyCode,inSmsCnt,supplierBriefName,buyPrice,buyCurrencyCode,outSmsCnt&groupBy=msgDate,customerBriefName,sellPrice,sellCurrencyCode,supplierBriefName,buyPrice,buyCurrencyCode"

4. The API call example to get an Overall Traffic Report for a period of time, by hour (grain=hour), returning date, customer, selling amount in platform currency, supplier, buying amount in platform currency, internal costs, profit and platform currency, grouped by date, customer, supplier and currency:

curl -X GET --header "Authorization: Bearer ACCESS_TOKEN" "https://api{separator}{platform_domain}/bulk/traffic-report/v2/overall-traffic-reports?startDt=2024-10-22T01:00:00Z&endDt=2024-10-22T08:00:00Z&grain=hour&embed=msgDate,customerBriefName,sellAmountInCurr,supplierBriefName,buyAmountInCurr,intCost,profit,currency&groupBy=msgDate,customerBriefName,supplierBriefName,currency"

2. Methods Overview

2.1 Traffic Reports

Endpoints to work with customer traffic reports.

GET/customer-invoices/{invoiceId}/traffic-reports
Returns a list of traffic reports for a given customer invoice ID.Read More
GET/customer-traffic-reports
Returns a list of customer traffic reports or CSV file with customer traffic reports.Read More

2.2 Control Traffic Reports

Endpoints to work with control traffic reports.

GET/control-invoices/{invoiceId}/traffic-reports
Returns a list of control traffic reports for a given control invoice ID.Read More
GET/control-traffic-reports
Returns a list of control traffic reports or CSV file with control traffic reports.Read More

2.3 Overall Traffic Reports

Endpoint for a list of overall traffic reports.

GET/overall-traffic-reports
Returns a list of overall traffic reports.Read More

3. Methods Details

3.1 Traffic Reports

Endpoints to work with customer traffic reports.

GET/customer-invoices/{invoiceId}/traffic-reports
Returns a list of traffic reports for a given customer invoice ID.Up
Method Overview

The method returns a list of traffic reports for a given customer invoice ID.

Authorization privilege needed for this endpoint: bulk-traffic-report.view.
Optional - privilege used for this endpoint: bulk-traffic-report-own.view.

This endpoint accepts query parameters for filtering data described on URL Filtering Guidelines page.

Parameters
Name Type Description
invoiceId (required) integer (path) Invoice ID.
operator(fieldName) string (query) Search criteria by using the following operators: isnull, isnotnull, isempty, isnotempty, eq, neq, startswith, contains, endswith, doesnotcontain, lt, lte, gt, gte, in, notin, between, notbetween, and the following attributes: customerId, billingAccountId, billingAccountName, countryId, countryName, countryCode2, operatorId, operatorName, sellPrice, sellPriceSinceDt, sellCurrency, sellCurrencyCode, mcc, mnc.

  • If operator is one of isnull, isnotnull, isempty, isnotempty, a field value can be omitted.
  • If operator is in or notin, a field value must be a comma separated list of values.
  • If operator is between or notbetween, a field value must be a comma separated list of two values, representing the beginning and the end of a range.
  • Operator can be omitted, and in that case it will be treated as operator is eq (E.g. fieldName=fieldValue).
  • Example: startswith(clientName)=hor, starts with hor in field 'clientName'.
  • If fieldName is 'q' and operator is eq or omitted, a field value will be used in general search across multiple attributes.
Responses
Code Description Link
200 List of traffic reports. No links.
Default Unexpected error. No links.
Success Response 200: List of Traffic Reports
{
  "data": [
    {
      "customerId": 0,
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "inSmsCnt": 0,
      "sellPrice": 0,
      "sellPriceSinceDt": "2023-02-23T13:39:35.427Z",
      "sellCurrency": 0,
      "sellCurrencyCode": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2023-02-23T13:39:35.427Z",
      "endDt": "2023-02-23T13:39:35.427Z",
      "totalAmount": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}
Error Response Unexpected Error: Default
{
  "Code": 0,
  "Message": "string"
}
GET/customer-traffic-reports
Returns a list of customer traffic reports or CSV file with customer traffic reports.Up
Method Overview

The method returns a list of customer traffic reports or CSV file with customer traffic reports. It generates billing reports for customers, with information associated with charges, payments, and balances.

Authorization privilege needed for this endpoint: bulk-traffic-report.view.
Optional - privilege used for this endpoint: bulk-traffic-report-own.view.

This endpoint accepts query parameters for filtering traffic reports described on URL Filtering Guidelines page.

Parameters
Name Type Description
startDate (required) string($date) (query) Start date.
endDate (required) string($date) (query) End date.
outputFormat string (query) Output format.
Available values: json, csv.
Default value: json.
operator(fieldName) string (query) Search criteria by using the following operators: isnull, isnotnull, isempty, isnotempty, eq, neq, startswith, contains, endswith, doesnotcontain, lt, lte, gt, gte, in, notin, between, notbetween, and the following attributes: customerId, customerBriefName, customerExtRefId, billingAccountId, billingAccountName, countryId, countryName, operatorId, operatorName.

  • If operator is one of isnull, isnotnull, isempty, isnotempty, a field value can be omitted.
  • If operator is in or notin, a field value must be a comma separated list of values.
  • If operator is between or notbetween, a field value must be a comma separated list of two values, representing the beginning and the end of a range.
  • Operator can be omitted, and in that case it will be treated as operator is eq (E.g. fieldName=fieldValue).
  • Example: startswith(clientName)=hor, starts with hor in field 'clientName'.
  • If fieldName is 'q' and operator is eq or omitted, a field value will be used in general search across multiple attributes.
Responses
Code Description Link
200 List of customer traffic reports or CSV file, depending on outputFormat parameter.
If the response is a CSV file, it will contain the following columns:
CUSTOMER_ID, CUSTOMER_NAME, CUSTOMER_REF_ID, PRICING_COND_ID, PRICING_COND_NAME, COUNTRY, OPERATOR, MCC, MNC, PRICE_PERIOD, SMS_COUNT, CURRENCY, PRICE, AMOUNT.
No links.
Default Unexpected error. No links.
Success Response 200: List of customer traffic reports or CSV file with customer traffic reports
{
  "data": [
    {
      "customerId": 0,
      "customerBriefName": "string",
      "customerExtRefId": "string",
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2024-09-16T11:59:45.520Z",
      "endDt": "2024-09-16T11:59:45.520Z",
      "inSmsCnt": 0,
      "sellCurrency": 0,
      "sellCurrencyCode": "string",
      "sellPrice": 0,
      "totalAmount": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}
Error Response Unexpected Error: Default
{
  "Code": 0,
  "Message": "string"
}

3.2 Control Traffic Reports

Endpoints to work with control traffic reports.

GET/control-invoices/{invoiceId}/traffic-reports
Returns a list of control traffic reports for a given control invoice ID.Up
Method Overview

The method returns a list of control traffic reports for a given control invoice ID.

Authorization privilege needed for this endpoint: bulk-traffic-report.view.
Optional - privilege used for this endpoint: bulk-traffic-report-own.view.

This endpoint accepts query parameters for filtering data described on URL Filtering Guidelines page.

Parameters
Name Type Description
invoiceId (required) integer (path) Invoice ID.
operator(fieldName) string (query) Search criteria by using the following operators: isnull, isnotnull, isempty, isnotempty, eq, neq, startswith, contains, endswith, doesnotcontain, lt, lte, gt, gte, in, notin, between, notbetween, and the following attributes: supplierId, billingAccountId, billingAccountName, countryId, countryName, countryCode2, operatorId, operatorName, buyPrice, buyPriceSinceDt, buyCurrency, buyCurrencyCode, mcc, mnc.

  • If operator is one of isnull, isnotnull, isempty, isnotempty, a field value can be omitted.
  • If operator is in or notin, a field value must be a comma separated list of values.
  • If operator is between or notbetween, a field value must be a comma separated list of two values, representing the beginning and the end of a range.
  • Operator can be omitted, and in that case it will be treated as operator is eq (E.g. fieldName=fieldValue).
  • Example: startswith(clientName)=hor, starts with hor in field 'clientName'.
  • If fieldName is 'q' and operator is eq or omitted, a field value will be used in general search across multiple attributes.
Responses
Code Description Link
200 List of control traffic reports. No links.
Default Unexpected error. No links.
Success Response 200: List of control traffic reports
{
  "data": [
    {
      "supplierId": 0,
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "outSmsCnt": 0,
      "buyPrice": 0,
      "buyPriceSinceDt": "2023-02-23T13:39:35.437Z",
      "buyCurrency": 0,
      "buyCurrencyCode": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2023-02-23T13:39:35.437Z",
      "endDt": "2023-02-23T13:39:35.437Z",
      "totalAmount": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}
Error Response Unexpected Error: Default
{
  "Code": 0,
  "Message": "string"
}
GET/control-traffic-reports
Returns a list of control traffic reports or CSV file with control traffic reports.Up
Method Overview

The method returns a list of control traffic reports or CSV file with control traffic reports. It generates billing reports for suppliers, with information associated with charges, payments, and balances.

Authorization privilege needed for this endpoint: bulk-traffic-report.view.
Optional - privilege used for this endpoint: bulk-traffic-report-own.view.

This endpoint accepts query parameters for filtering control traffic reports described on URL Filtering Guidelines page.

Parameters
Name Type Description
startDate (required) string($date) (query) Start date.
endDate (required) string($date) (query) End date.
outputFormat string (query) Output format.
Available values: json, csv.
Default value: json.
operator(fieldName) string (query) Search criteria by using the following operators: isnull, isnotnull, isempty, isnotempty, eq, neq, startswith, contains, endswith, doesnotcontain, lt, lte, gt, gte, in, notin, between, notbetween, and the following attributes: supplierId, supplierBriefName, supplierExtRefId, billingAccountId, billingAccountName, countryId, countryName, operatorId, operatorName.

  • If operator is one of isnull, isnotnull, isempty, isnotempty, a field value can be omitted.
  • If operator is in or notin, a field value must be a comma separated list of values.
  • If operator is between or notbetween, a field value must be a comma separated list of two values, representing the beginning and the end of a range.
  • Operator can be omitted, and in that case it will be treated as operator is eq (E.g. fieldName=fieldValue).
  • Example: startswith(clientName)=hor, starts with hor in field 'clientName'.
  • If fieldName is 'q' and operator is eq or omitted, a field value will be used in general search across multiple attributes.
Responses
Code Description Link
200 List of control traffic reports or CSV file, depending on outputFormat parameter.
If the response is a CSV file, it will contain the following columns:
SUPPLIER_ID, SUPPLIER_NAME, SUPPLIER_REF_ID, PRICING_COND_ID, PRICING_COND_NAME, COUNTRY, OPERATOR, MCC, MNC, PRICE_PERIOD, SMS_COUNT, CURRENCY, PRICE, AMOUNT
No links.
Default Unexpected error. No links.
Success Response 200: List of control traffic reports or CSV file with control traffic reports
{
  "data": [
    {
      "supplierId": 0,
      "supplierBriefName": "string",
      "supplierExtRefId": "string",
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2024-09-16T12:12:42.480Z",
      "endDt": "2024-09-16T12:12:42.480Z",
      "outSmsCnt": 0,
      "buyCurrency": 0,
      "buyCurrencyCode": "string",
      "buyPrice": 0,
      "totalAmount": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}
Error Response Unexpected Error: Default
{
  "Code": 0,
  "Message": "string"
}

3.3 Overall Traffic Reports

Endpoint for a list of overall traffic reports.

GET/overall-traffic-reports
Returns a list of overall traffic reports.Up
Method Overview

The method returns a list of overall traffic reports.

Authorization privilege needed for this endpoint: bulk-traffic-report.view.
Optional - privilege used for this endpoint: bulk-traffic-report-own.view.

This endpoint accepts query parameters for filtering traffic reports described on URL Filtering Guidelines page.

Please find the examples of the endpoint use in the API Call Examples section.

Errors
Name Description
BULK_TRAFFIC_REPORT_API_V2:BULK_SETTINGS_NOT_FOUND Bulk settings not found.
BULK_TRAFFIC_REPORT_API_V2:START_DT_MISSING The startDt parameter is required.
BULK_TRAFFIC_REPORT_API_V2:END_DT_MISSING The endDt parameter is required.
BULK_TRAFFIC_REPORT_API_V2:START_DT_AFTER_END_DT StartDt cannot be after endDt.
BULK_TRAFFIC_REPORT_API_V2:UNSUPPORTED_GRAIN Requested grain is not supported.
BULK_TRAFFIC_REPORT_API_V2:UNSUPPORTED_EMBEDDED_FIELD Requested embedded field is not supported.
BULK_TRAFFIC_REPORT_API_V2:UNSUPPORTED_GROUP_BY_FIELD Requested group by field is not supported.
BULK_TRAFFIC_REPORT_API_V2:MAX_EXECUTION_TIME_EXCEEDED For the requested parameters maximum execution time has been exceeded.
Parameters
Name Type Description
embed string (query) Embedded fields: Comma separated list of fields that needs to be returned in the response object.
Embed available properties: msgDate, accountDim, billingAccountDim, customerDim, countryId, operatorDim, gateDim, billingGateDim, sellPrice, sellAmount, sellCurrency, inSmsCnt, inBilledSmsCnt, buyPrice, buyAmount, buyCurrency, outSmsCnt, outBilledSmsCnt, currency, sellAmountInCurr, buyAmountInCurr, intCost, intRequestCnt, profit, stProcessingCnt, stSentCnt, stRejectNackCnt, stRejectRulesCnt, stErrorCnt, stUnknownCnt, customerId, customerBriefName, billingAccountId, billingAccountName, supplierId, supplierBriefName, gateBillingAccountId, gateBillingAccountName, accountId, accountName, gateId, gateName, countryName, countryCode2, operatorId, operatorName, currencyCode, sellCurrencyCode, buyCurrencyCode, mcc, mnc, isMobile and msgDt (only if grain=hour).

If the embed parameter is empty, the following default properties will be returned: msgDate, customerId, customerBriefName, billingAccountId, billingAccountName, accountId, accountName, supplierId, supplierBriefName, gateBillingAccountId, gateBillingAccountName, gateId, gateName, countryId, countryCode2, operatorId, operatorName, sellPrice, sellAmount, sellCurrencyCode, sellAmountInCurr, buyPrice, buyAmount, buyCurrencyCode, buyAmountInCurr, profit, currencyCode, inSmsCnt, inBilledSmsCnt, outSmsCnt, outBilledSmsCnt, intCost, intRequestCnt, stProcessingCnt, stSentCnt, stRejectNackCnt, stRejectRulesCnt, stErrorCnt, stUnknownCnt, mcc, mnc and msgDt (only if grain=hour).

groupBy string (query) GroupBy fields: Comma separated list of fields by which traffic is grouped.
GroupBy available properties: msgDate, accountDim, billingAccountDim, customerDim, countryId, operatorDim, gateDim, billingGateDim, sellPrice, sellCurrency, buyPrice, buyCurrency, currency, customerId, customerBriefName, billingAccountId, billingAccountName, supplierId, supplierBriefName, gateBillingAccountId, gateBillingAccountName, accountId, accountName, gateId, gateName, countryName, countryCode2, operatorId, operatorName, currencyCode, sellCurrencyCode, buyCurrencyCode, mcc, mnc, isMobile and msgDt (only if grain=hour).
GroupBy rules:
  • If groupBy parameter is used and some of groupBy available properties are in the embed parameter, they must also be in the groupBy parameter. If not, the API will add them itself.
  • If groupBy parameter is used and sellAmount is in the embed parameter, sellCurrency or sellCurrencyCode should be in the groupBy parameter. If not, the API will add sellCurrencyCode to the groupBy and embed parameters itself.
  • If groupBy parameter is used and buyAmount is in the embed parameter, buyCurrency or buyCurrencyCode should be in the groupBy parameter. If not, the API will add buyCurrencyCode to the groupBy and embed parameters itself.
  • If groupBy parameter is used and one of the properties sellAmountInCurr, buyAmountInCurr, profit or intCost is in the embed parameter, currency or currencyCode should be in the groupBy parameter. If not, the API will add currencyCode to the groupBy and embed parameters itself.
Aggregated fields: sellAmount, inSmsCnt, inBilledSmsCnt, buyAmount, outSmsCnt, outBilledSmsCnt, sellAmountInCurr, buyAmountInCurr, intRequestCnt, profit, stProcessingCnt, stSentCnt, stRejectNackCnt, stRejectRulesCnt, stErrorCnt, stUnknownCnt, intCost.
startDt (required) string($date‑time Y‑m‑d\TH:i:s\Z) (query) Start date and time.
endDt (required) string($date‑time Y‑m‑d\TH:i:s\Z) (query) End date and time.
grain string (query) Time grain.
Available values: day, hour.
Default value: day.
sort string (query) Sort criteria:
Field name for ASC sorting, -Field name for DESC sorting.
Example:
name = "name ASC", -name = "name DESC"

Sort available properties: msgDate, accountDim, billingAccountDim, customerDim, countryId, operatorDim, gateDim, billingGateDim, sellPrice, sellAmount, sellCurrency, inSmsCnt, inBilledSmsCnt, buyPrice, buyAmount, buyCurrency, outSmsCnt, outBilledSmsCnt, currency, sellAmountInCurr, buyAmountInCurr, intCost, intRequestCnt, profit, stProcessingCnt, stSentCnt, stRejectNackCnt, stRejectRulesCnt, stErrorCnt, stUnknownCnt, customerId, customerBriefName, billingAccountId, billingAccountName, supplierId, supplierBriefName, gateBillingAccountId, gateBillingAccountName, accountId, accountName, gateId, gateName, countryName, countryCode2, operatorId, operatorName, currencyCode, sellCurrencyCode, buyCurrencyCode, mcc, mnc and msgDt (only if grain=hour).

operator(fieldName) string (query) Search criteria by using the following operators: isnull, isnotnull, isempty, isnotempty, eq, neq, startswith, contains, endswith, doesnotcontain, lt, lte, gt, gte, in, notin, between, notbetween,
and by the following attributes: accountDim, billingAccountDim, customerDim, operatorDim, gateDim, billingGateDim, sellPrice, sellAmount, inSmsCnt, inBilledSmsCnt, buyPrice, buyAmount, buyCurrency, outSmsCnt, outBilledSmsCnt, currency, sellAmountInCurr, buyAmountInCurr, intCost, intRequestCnt, profit, stProcessingCnt, stSentCnt, stRejectNackCnt, stRejectRulesCnt, stErrorCnt, stUnknownCnt, customerId, customerBriefName, billingAccountId, billingAccountName, supplierId, supplierBriefName, gateBillingAccountId, gateBillingAccountName, accountId, accountName, gateId, gateName, currencyCode, buyCurrencyCode, countryId, countryName, countryCode2, operatorId, operatorName, sellPrice, sellPriceSinceDt, sellCurrency, sellCurrencyCode, mcc, mnc.

  • If operator is one of isnull, isnotnull, isempty, isnotempty, a field value can be omitted.
  • If operator is in or notin, a field value must be a comma separated list of values.
  • If operator is between or notbetween, a field value must be a comma separated list of two values, representing the beginning and the end of a range.
  • Operator can be omitted, and in that case it will be treated as operator is eq (E.g. fieldName=fieldValue).
  • Example: startswith(clientName)=hor, starts with hor in field 'clientName'.
  • If fieldName is 'q' and operator is eq or omitted, a field value will be used in general search across multiple attributes.
Responses
Code Description Link
200 List of overall traffic reports. No links.
Default Unexpected error. No links.
Success Response 200: List of Overall Traffic Reports
{
  "data": [
    {
      "msgDate": "2024-10-22",
      "msgDt": "2024-10-22T13:12:23.769Z",
      "accountDim": 0,
      "billingAccountDim": 0,
      "customerDim": 0,
      "countryId": 0,
      "operatorDim": 0,
      "gateDim": 0,
      "billingGateDim": 0,
      "sellPrice": 0,
      "sellAmount": 0,
      "sellCurrency": 0,
      "sellCurrencyCode": "string",
      "inSmsCnt": 0,
      "inBilledSmsCnt": 0,
      "buyPrice": 0,
      "buyAmount": 0,
      "buyCurrency": 0,
      "buyCurrencyCode": "string",
      "outSmsCnt": 0,
      "outBilledSmsCnt": 0,
      "currency": "string",
      "currencyCode": "string",
      "sellAmountInCurr": 0,
      "buyAmountInCurr": 0,
      "intCost": 0,
      "intRequestCnt": 0,
      "profit": 0,
      "stProcessingCnt": 0,
      "stSentCnt": 0,
      "stRejectNackCnt": 0,
      "stRejectRulesCnt": 0,
      "stErrorCnt": 0,
      "stUnknownCnt": 0,
      "customerId": 0,
      "customerBriefName": "string",
      "billingAccountId": 0,
      "billingAccountName": "string",
      "supplierId": 0,
      "supplierBriefName": "string",
      "gateBillingAccountId": 0,
      "gateBillingAccountName": "string",
      "accountId": 0,
      "accountName": "string",
      "gateId": 0,
      "gateName": "string",
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "mcc": "string",
      "mnc": "string",
      "isMobile": "yes"
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "perPage": 0,
      "currentPage": 0,
      "totalPages": 0
    }
  }
}
Error Response Unexpected Error: Default
{
  "Code": 0,
  "Message": "string"
}

4. Data Models

Data Models define the structure of a JSON document and describe the data related to the Traffic Report API. It contains data for the Billing Account, Country, Operator, Prices, etc.

4.1 TrafficReportCollection

TrafficReportCollection object properties:

Name Type Description
data (required) array Array of TrafficReport objects.
meta (required) object CollectionMeta object

4.2 TrafficReport

TrafficReport object properties:

Name Type Description
customerId integer Customer ID.
billingAccountId integer ID of Pricing Conditions Template.
billingAccountName string Name of Pricing Conditions Template.
countryId integer Country ID.
countryName string Name of the Country.
countryCode2 string Country code.
operatorId integer Operator ID.
operatorName string Operator name.
inSmsCnt integer Quantity per unit.
sellPrice number($float) Price per unit.
sellPriceSinceDt string($date-time) Selling price from a given date.
sellCurrency integer ID of selling price currency.
sellCurrencyCode string SellCurrency code.
mcc string Mobile country code.
mnc string Mobile network code.
startDt string($date-time) Start date.
endDt string($date‑time) End date.
totalAmount number($float) TotalAmount is price per unit multiplied by quantity per unit (totalAmount = sellPrice * inSmsCnt).
JSON Example
{
  "data": [
    {
      "customerId": 0,
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "inSmsCnt": 0,
      "sellPrice": 0,
      "sellPriceSinceDt": "2023-02-23T13:39:35.427Z",
      "sellCurrency": 0,
      "sellCurrencyCode": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2023-02-23T13:39:35.427Z",
      "endDt": "2023-02-23T13:39:35.427Z",
      "totalAmount": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}

4.3 CustTrafficReportCollection

CustTrafficReportCollection object properties:

Name Type Description
data (required) array Array of CustTrafficReport objects.
meta (required) object CollectionMeta object

4.4 CustTrafficReport

CustTrafficReport object properties:

Name Type Description
customerId integer Customer ID.
customerBriefName string Customer brief name.
customerExtRefId string Customer external referent ID.
billingAccountId integer ID of Pricing Condition.
billingAccountName string Name of Pricing Condition.
countryId integer Country ID.
countryName string Country name.
countryCode2 string Country code.
operatorId integer Operator ID.
operatorName string Operator name.
mcc string Mobile country code.
mnc string Mobile network code.
startDt string($date-time) Start date.
endDt string($date‑time) End date.
inSmsCnt integer Quantity per unit.
sellCurrency integer ID of selling price currency.
sellCurrencyCode string Selling price currency code.
sellPrice number($float) Price per unit.
totalAmount number($float) totalAmount is price per unit multiplied by quantity per unit (totalAmount = sellPrice * inSmsCnt).
JSON Example
{
  "data": [
    {
      "customerId": 0,
      "customerBriefName": "string",
      "customerExtRefId": "string",
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2024-09-16T11:59:45.520Z",
      "endDt": "2024-09-16T11:59:45.520Z",
      "inSmsCnt": 0,
      "sellCurrency": 0,
      "sellCurrencyCode": "string",
      "sellPrice": 0,
      "totalAmount": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}

4.5 ContTrafficReportCollection

ContTrafficReportCollection object properties:

Name Type Description
data (required) array Array of ContTrafficReport objects.
meta (required) object CollectionMeta object

4.6 ContTrafficReport

ContTrafficReport object properties:

Name Type Description
supplierId integer Supplier ID.
supplierBriefName string Supplier brief name.
supplierExtRefId string Supplier external referent ID.
billingAccountId integer ID of Pricing Condition.
billingAccountName string Name of Pricing Condition.
countryId integer Country ID.
countryName string Country name.
countryCode2 string Country code.
operatorId integer Operator ID.
operatorName string Operator name.
mcc string Mobile country code.
mnc string Mobile network code.
startDt string($date-time) Start date.
endDt string($date‑time) End date.
outSmsCnt integer Quantity per unit.
buyCurrency integer ID of buying price currency.
buyCurrencyCode string Buying price currency code.
buyPrice number($float) Price per unit.
totalAmount number($float) totalAmount is price per unit multiplied by quantity per unit (totalAmount = sellPrice * outSmsCnt).
JSON Example
{
  "data": [
    {
      "supplierId": 0,
      "supplierBriefName": "string",
      "supplierExtRefId": "string",
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2024-09-16T13:06:21.442Z",
      "endDt": "2024-09-16T13:06:21.442Z",
      "outSmsCnt": 0,
      "buyCurrency": 0,
      "buyCurrencyCode": "string",
      "buyPrice": 0,
      "totalAmount": 0
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 0,
      "per_page": 0,
      "current_page": 0,
      "total_pages": 0,
      "links": {
        "first": "string",
        "last": "string",
        "prev": "string",
        "next": "string"
      }
    }
  }
}

4.7 OverallTrafficCollection

OverallTrafficCollection object properties:

Name Type Description
data (required) array Array of OverallTraffic objects.
meta (required) object CollectionMeta object

4.8 OverallTraffic

OverallTraffic object properties:

Name Type Description
msgDate string($date) Message date.
msgDt string($date‑time) Message date and time is returned only if grain=hour.
accountDim integer Account dimension.
billingAccountDim integer Billing account dimension.
customerDim integer Customer dimension.
countryId integer Country ID.
operatorDim integer Operator dimension.
gateDim integer Gate dimension.
billingGateDim integer Gate billing account dimension.
sellPrice number($float) sellPrice is Customer price per unit.
sellAmount number($float) sellAmount is selling price per unit multiplied by quantity per unit (sellAmount = sellPrice * inSmsCnt).
sellCurrency integer sellCurrency is ID of selling price currency.
sellCurrencyCode string Selling price currency code.
inSmsCnt integer inSmsCnt is number of messages received from customer for sending.
inBilledSmsCnt integer inBilledSmsCnt is number of messages billed to customer.
buyPrice number($float) buyPrice is supplier price per unit.
buyAmount number($float) buyAmount is buying price per unit multiplied by quantity per unit (buyAmount = buyPrice * outSmsCnt).
buyCurrency integer buyCurrency is ID of buying price currency.
buyCurrencyCode string Buying price currency code.
outSmsCnt integer outSmsCnt is number of messages sent by the supplier.
outBilledSmsCnt integer outBilledSmsCnt is number of messages billed to supplier.
currency string currency is ID of platform currency.
currencyCode string Currency code.
sellAmountInCurr number($float) sellAmountInCurr is selling amount in platform currency.
buyAmountInCurr number($float) buyAmountInCurr is buying amount in platform currency.
intCost number($float) intCost is the internal cost.
intRequestCnt integer Number of MNP queries.
profit number($float) profit = sellAmountInCurr - buyAmountInCurr - intCost
stProcessingCnt integer Number of messages in statuses 'New', 'Waiting to be sent' and 'Waiting for MNP'.
stSentCnt integer Number of messages in status 'Sent'.
stRejectNackCnt integer Number of messages in status 'Rejected by NACK'.
stRejectRulesCnt integer Number of messages in status 'Rejected by Rules'.
stErrorCnt integer Number of messages in status 'Error'.
stUnknownCnt integer Number of messages in another (unknown) status.
customerId integer Customer ID.
customerBriefName string Customer brief name.
billingAccountId integer billingAccountId is ID of Pricing Condition.
billingAccountName string billingAccountName is name of Pricing Condition.
supplierId integer Supplier ID.
supplierBriefName string Supplier brief name.
gateBillingAccountId integer gateBillingAccountId is ID of Supplier Pricing Condition.
gateBillingAccountName string gateBillingAccountName is name of Supplier Pricing Condition.
accountId integer accountId is ID of Customer connection.
accountName string accountName is name of Customer connection.
gateId integer gateId is ID of Supplier Gateway.
gateName string gateName is name of Supplier Gateway.
countryName string Country name.
countryCode2 string Country code2.
operatorId integer Operator ID.
operatorName string Operator name.
mcc string Mobile country code.
mnc integer Mobile Network code.
isMobile string Is operator a mobile network. Possible values: yes, no.

4.9 Error

Error object properties:

Name Type Description
code (required) integer($int32) Error code.
message (required) string Error message.
JSON Example
{
  "Code": 0,
  "Message": "string"
}
Error list
Response code Response body Message
401 NOT_AUTHORIZED Not authorized.
500 INT_APP_ERROR BULK_GATE instance not found.
500 INT_APP_ERROR Internal server error.
400 REQUEST_ERROR Query parameter: 'propertyName' error: 'error message'.
404 BULK_TRAFFIC_REPORT_API_V2:BULK_RATES_SETTINGS_NOTFOUND Bulk rates settings not found.

4.10 CollectionMeta

CollectionMeta object properties:

Name Type Description
pagination object CollectionMetaPagination object

4.11 CollectionMetaPagination

CollectionMetaPagination object properties:

Name Type Description
total (required) integer Total number of rows.
count (required) integer A number of rows in the current page.
per_page (required) integer The maximum rows per page.
current_page (required) integer The current page number.
total_pages (required) integer Total number of pages.
links (required) object CollectionMetaPaginationLinks object

4.12 CollectionMetaPaginationLinks

CollectionMetaPaginationLinks object properties:

Name Type Description
first string Link to the first page.
last string Link to the last page.
prev string Link to the previous page.
next string Link to the next page.