sTN Partner APIsTN Partner API
Home
Getting Started
Guide
Home
Getting Started
Guide
  • Guide

    • Introduction
    • Supported Features
    • Authentication
    • Base URLs
    • Advanced Query Parameters
    • Error Handling
  • Getting Started

    • Introduction
    • Quick Start Guide
  • API Endpoints

    • QuerySimcard
    • QueryActivation
    • QuerySubscription
    • NewSubscription
    • CancelNewSubscription
    • SuspendSubscription
    • ResumeSubscription
    • SimSwapSubscription
    • SetServicesSubscription
    • MoveEnvironmentSubscription
    • InPortSubscription
    • ChangeInPortSubscription
    • CancelInPortSubscription
    • PortingOutSubscription
    • CancelPortingOutSubscription
    • TerminateSubscription
    • CancelTerminateSubscription
    • QueryInvoice
    • QueryCdrMonth
    • QueryCdr
    • QueryUsageSubscription

QueryCdr

Overview

  • Method: GET
  • Endpoint: /api/QueryCdr
  • Description: Retrieves a list of Call Detail Records (CDRs) based on specified filters and sorting criteria.
GET /api/QueryCdr

Query Parameters

The following parameters can be used to filter and sort the results:

  • yearMonth (string, required): Filter by year and month (YYYY_MM).
  • id (string, optional): Filter by specific CDR ID.
  • customerId (string, optional): Filter by customer ID.
  • phoneNumber (string, optional): Filter by phone number.
  • include (string, optional): Related data to include in the response.
  • fields (string, optional): Specific fields to include in the response.
  • meta (string, optional): Additional metadata for the query.
  • take (integer, optional): Number of results to return (pagination).
  • skip (integer, optional): Number of results to skip (pagination).
  • orderBy / orderByDesc (string, optional): Sort results in ascending or descending order by a specific field.

Response Structure

The response will contain metadata about the queried CDRs:

{
    "offset": 0,
    "total": 90,
    "results": [
        {
            "id": "###9fa78###8e251c49",
            "subscriptionId": "###AM8FA###bc9no6",
            "phoneNumber": "06-######290",
            "yearMonth": "2025_01",
            "providerGroup": "KPNMOBIEL",
            "description": "Bellen naar mobiel",
            "rateClass": "N_MOBOV",
            "usageDate": "2024-12-27T10:29:48Z",
            "volume": 5,
            "amount": 0,
            "destination": "316#######94",
            "countryCodeOwn": "NL",
            "countryCodeDestination": "NL"
        },
        {
            "id": "###9fa79###8e251c4a",
            "subscriptionId": "###tSUso###PpTVze",
            "phoneNumber": "06-######611",
            "yearMonth": "2025_01",
            "providerGroup": "KPNMOBIEL",
            "description": "Internet nationaal",
            "rateClass": "INT_NAT",
            "usageDate": "2024-12-19T10:17:23Z",
            "volume": 31,
            "amount": 0.0002,
            "destination": "000INTERNET",
            "countryCodeOwn": "NL"
        },
        {
            "id": "###9fa79###8e251c4b",
            "subscriptionId": "###tSUso###PpTVze",
            "phoneNumber": "06-######611",
            "yearMonth": "2025_01",
            "providerGroup": "KPNMOBIEL",
            "description": "Internet nationaal",
            "rateClass": "INT_NAT",
            "usageDate": "2024-12-19T18:17:24Z",
            "volume": 18,
            "amount": 0.0001,
            "destination": "000INTERNET",
            "countryCodeOwn": "NL"
        },
        {
            "id": "###9fa79###8e251c4c",
            "subscriptionId": "###tSUso###PpTVze",
            "phoneNumber": "06-######611",
            "yearMonth": "2025_01",
            "providerGroup": "KPNMOBIEL",
            "description": "Internet nationaal",
            "rateClass": "INT_NAT",
            "usageDate": "2024-12-20T02:17:24Z",
            "volume": 458,
            "amount": 0.0022,
            "destination": "000INTERNET",
            "countryCodeOwn": "NL"
        }
    ],
    "meta": {}
}

Field Descriptions

  • id: Unique identifier for the CDR record.
  • subscriptionId: ID of the subscription associated with the record.
  • phoneNumber: The phone number linked to the CDR entry.
  • yearMonth: The year and month of the record in YYYY_MM format.
  • providerGroup: The provider group handling the service.
  • userName: The user associated with the CDR.
  • description: Description of the CDR entry.
  • rateClass: Classification of the rate applied to the call.
  • usageDate: Timestamp of when the usage occurred.
  • volume: The volume used. Units are kB for internet, seconds for voice and pieces for sms.
  • amount: The charge associated with the record.
  • destination: The destination number or service contacted.
  • countryCodeOwn: The country code of the caller.
  • countryCodeDestination: The country code of the recipient.

Info

The response provides detailed metadata for each CDR record, including call and data usage details.


Usage Notes

  • Combine filters like yearMonth and phoneNumber to refine search results.

  • Use pagination (take and skip) to manage large result sets.

  • orderBy and orderByDesc allow sorting results by a specific field.

  • To improve query performance, use QueryCdrMonth before querying this endpoint to ensure the requested data exists.

Table 'rateclass'

codeinvoice_descriptiontraffic_typeforeign_country_typemo_mt
BEELDBELLENBeeldbellenVOICENATIONALMO
DOORSCHAKELDoorgeschakelde gesprekkenVOICENATIONALMO
IAO_BENEFITBellen vanuit voordeellandenVOICEINTERNATIONALMO
IAO_EUBellen vanuit de EUVOICEINTERNATIONALMO
IAO_RESTEUBellen vanuit de rest van EuropaVOICEINTERNATIONALMO
IAO_SATBellen vanuit satellietVOICEINTERNATIONALMO
IAO_SPECBellen vanuit speciale landenVOICEINTERNATIONALMO
IAO_USCANBellen vanuit VS of CanadaVOICEINTERNATIONALMO
IAO_WORLDBellen vanuit de rest van de wereldVOICEINTERNATIONALMO
IAT_BENEFITGebeld worden in voordeellandenVOICEINTERNATIONALMT
IAT_EUGebeld worden in de EUVOICEINTERNATIONALMT
IAT_RESTEUGebeld worden in de rest van EuropaVOICEINTERNATIONALMT
IAT_SATGebeld worden satellietVOICEINTERNATIONALMT
IAT_SPECGebeld worden in speciale landenVOICEINTERNATIONALMT
IAT_USCANGebeld worden in VS of CanadaVOICEINTERNATIONALMT
IAT_WORLDGebeld worden in de rest van de wereldVOICEINTERNATIONALMT
IAS_BENEFITSMS vanuit voordeellandenSMSINTERNATIONALMO
IAS_EUSMS vanuit de EUSMSINTERNATIONALMO
IAS_SATSMS vanuit satellietSMSINTERNATIONALMO
IAS_USCANSMS vanuit VS of CanadaSMSINTERNATIONALMO
IAS_WORLDSMS vanuit de rest van de wereldSMSINTERNATIONALMO
INT_BENEFITInternet in voordeellandenDATAINTERNATIONALMO
INT_BENEFITEXTRAInternet in extra voordeellandenDATAINTERNATIONALMO
INT_EUInternet EUDATAINTERNATIONALMO
INT_NATInternet nationaalDATANATIONALMO
INT_SATInternet via satellietDATAINTERNATIONALMO
INT_USCANInternet in VS of CanadaDATAINTERNATIONALMO
INT_WORLDInternet in de rest van de wereldDATAINTERNATIONALMO
MMSMMSMMSNATIONALMO
MOBSERVMobiele dienstenDATANATIONALMO
N_FIXEDBellen naar vaste nummersVOICENATIONALMO
N_FREEGratis nummerVOICENATIONALMO
N_MOBOVBellen naar mobielVOICENATIONALMO
N_SMSSms-berichtenSMSNATIONALMO
PRMINFOServicenummersVOICENATIONALMO
PRMINFOENT0906/0909 nummersVOICENATIONALMO
PRMINFOFWD_SERVBemiddeling/nummerinfo - dienstVOICENATIONALMO
PRMINFOFWD_TRAFBemiddeling/nummerinfo - verkeerVOICENATIONALMO
PRMINFONOVAT_SERV0900 nummers BTW-vrij - dienstVOICENATIONALMO
PRMINFONOVAT_TRAF0900 nummers BTW-vrij - verkeerVOICENATIONALMO
PRMINFOPERS06-InformatienummersVOICENATIONALMO
PRMINFOSERV_SERV0900 Servicenummers - dienstVOICENATIONALMO
PRMINFOSERV_TRAF0900 Servicenummers - verkeerVOICENATIONALMO
PRMSMSSms info: zie www.payinfo.nlSMSNATIONALMT
TAO_BENEFITBellen naar voordeellandenVOICEINTERNATIONALMO
TAO_EUBellen naar een EU-landVOICEINTERNATIONALMO
TAO_RESTEUBellen naar de rest van EuropaVOICEINTERNATIONALMO
TAO_SATBellen naarsatellietVOICEINTERNATIONALMO
TAO_SPECBellen naar speciale landenVOICEINTERNATIONALMO
TAO_USCANBellen naar VS of CanadaVOICEINTERNATIONALMO
TAO_WORLDBellen naar de rest van de wereldVOICEINTERNATIONALMO
TAS_BENEFITSMS naar voordeellandenSMSINTERNATIONALMO
TAS_EUSMS naar een EU-landSMSINTERNATIONALMO
TAS_SATSMS naar satellietSMSINTERNATIONALMO
TAS_USCANSMS naar VS of CanadaSMSINTERNATIONALMO
TAS_WORLDSMS naar de rest van de wereldSMSINTERNATIONALMO

Example Requests

Retrieve all CDRs for a specific year and month

GET /api/QueryCdr?yearMonth=2024_01

Retrieve CDRs for a specific phone number

GET /api/QueryCdr?phoneNumber=0612345678

Paginate through results, 50 records at a time

GET /api/QueryCdr?yearMonth=2024_01&skip=0&take=50

Sort results by usage date in descending order

GET /api/QueryCdr?yearMonth=2024_01&orderByDesc=usageDate

Summary

The /api/QueryCdr endpoint provides detailed records of call and data usage.

  • Requires yearMonth as a mandatory filter.
  • Supports filtering by phone number, customer ID, and other metadata.
  • Allows sorting and pagination for optimized data retrieval.
  • Provides detailed information on call destinations, charges, and volume usage.

Use this API to retrieve and analyze Call Detail Records efficiently.

Last Updated:
Contributors: UP2media-AR, Jos Harink
Prev
QueryCdrMonth
Next
QueryUsageSubscription