Traffic report API v2

1. Introduction

The HORISEN Traffic report API is used for creating traffic reports for the BULK SMS API

This API returns information about traffic associated with the invoice with given id. It returns the number of messages sent, the price per message and the total amount for each pricing condition, country, operator and sell price. The requests are carried out using a GET method.

This API belongs to the Traffic Report domain. Subject Domain in the endpoint url is:

https://api.horisen.pro/bulk-traffic-report/v2

The API uses the HORISEN implementation of the OAuth 2.0 protocol. For more information refer to the Oauth2 Authentication Guidelines

2. Methods Overview

GET/customer-invoices/{invoiceId}/traffic-reports
List of traffic reportsRead More
GET/control-invoices/{invoiceId}/traffic-reports
List of control traffic reportsRead More

3. Methods Details

GET/customer-invoices/{invoiceId}/traffic-reports
List of traffic reportsUp

Parameters

Name Type Description
InvoiceId (required) Integer Invoice id
operator(field name) String

Search criteria using following operators :

  • isnull
  • isnotnull
  • isempty
  • isnotempty
  • eq
  • neq
  • startswith
  • contains
  • endswith
  • doesnotcontain
  • lt
  • lte
  • gt
  • gte
  • in
  • notin
  • between
  • notbetween

And by 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 field value can be ommited.

If operator is in or notin field value must be coma separated list of values.

If operator is between or notbetween field value must be coma separated list of two values representing beginning and the end of range.

Operator can be ommited and in that case it will be treated as operator is eq (Eg: fieldName=fieldValue)

Example: startswith(clientName)=hor, starts with hor in field clientName if fieldName is q and operator is eq or ommited, field value will be used in general search across multiple attributes.

Please follow this link for the further info about Operators in URL Filtering

Responses

Code Descprition Link
200 List of traffic reports No Links
Default List of errors No links
GET/control-invoices/{invoiceId}/traffic-reports
List of control traffic reportsUp

Data list

Data fields describe all the data related to the Traffic Report. It contains data for the Billing Account, Country, Operator, Prices, etc.

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) Sell price from a given date
sellCurrency integer Id of sell 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

Here is an example of JSON:

"data": [
    {
     "supplierId": 0,
      "billingAccountId": 0,
      "billingAccountName": "string",
      "countryId": 0,
      "countryName": "string",
      "countryCode2": "string",
      "operatorId": 0,
      "operatorName": "string",
      "outSmsCnt": 0,
      "buyPrice": 0,
      "buyPriceSinceDt": "2020-11-03T14:24:00.561Z",
      "buyCurrency": 0,
      "buyCurrencyCode": "string",
      "mcc": "string",
      "mnc": "string",
      "startDt": "2020-11-03T14:24:00.561Z",
      "endDt": "2020-11-03T14:24:00.561Z",
      "totalAmount": 0
    }
  ]

Meta

Meta contains data for the number of rows and pages that have been received and Links for the first, last, previous and next page for given API call

Name Type Description
collectionMeta Object This is a meta pagination object
Name Type Description
collectionMetaPagination Object This is a collection Meta Pagination Object
Name Type Description
collectionMetaPaginationLinks Object This is a collection Meta Pagination Object links
collectionMetaPagination properties Type Description
total integer Total number of rows
count integer Number of rows in current page
per_page integer The maximum rows per page
current_page integer Number of current page
total_pages integer Total number of pages
total_pages integer Total number of pages
collectionMetaPaginationLinks properties Type Description
first string Optional object with attribute "first",
last string Optional object with attribute "last"
prev string Optional object with attribute "prev"
next string Optional object with attribute "next"

NOTE: collectionMetaPaginationLinks should contain links for the first, last, previous and next page for given API call.

JSON Example

"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 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.