User Tools

Site Tools


api:mvno:account:cdr

API : MVNO CDR

Introduction

This request will return CDR data for the MVNO account.

This is a limited view into the CDR records. To access CDR data with all the details, you must access it via the CDR API.

Request

URL https://api.telecomx.dk/mvno/ACCOUNT_ID/cdr
Method GET
Access level VIEWER, MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller.
RESELLER_ADMIN.
ADMIN.
Param ACCOUNT_ID Id of the MVNO account (24 hex-char string). An account of another type is not found on this URL.
Query fromDate [optional] First day to return CDR records for, any ISO 8601 date (e.g. 2026-07-23 or 2026-07-23T00:00:00Z). The time of day is ignored - the day starts at 00:00 Danish time. Defaults to today.
toDate [optional] Last day to return CDR records for, same format. The day ends at 23:59:59 Danish time. Defaults to today.
limit [optional] Max number of CDR records to return, default 100 (1-1000000). Excel output is capped at 65000 rows.
offset [optional] Offset for paging, index of first CDR record to return, default 0.
filter [optional] Search text that looks into A number, B number, users name and users extension. Case-insensitive, every word must match.
direction [optional] Direction of the call, 'IN' or 'OUT'. Any other value, or omitted, returns both directions.
format [optional] Format for output: json (default), csv or excel. Any other value gives json.

A request matching more than 300000 CDR records is refused - ask for a shorter period.

Query example

https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr
https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr?fromDate=2026-07-23
https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr?fromDate=2026-07-23&toDate=2026-07-31&limit=1000&offset=100&filter=12345678
https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/cdr?fromDate=2026-07-23&toDate=2026-07-31&limit=1000000&format=csv

Response

If format is CSV or Excel the response is a file for download (cdr.csv or cdr.xlsx) with the columns type, aNumber, bNumber, diverter, start, length, talkLength (only if the customer uses duration method 1), terminationCause, terminatedBy, destination, roaming (1 or 0), roamingCountry, roamingRegion, price, userName, userLocation, userExtension. The destination column is a text, e.g. 'DK fixed', 'DK mobile' or the name of a danish special number; the start column is dd-MM-yyyy hh:mm:ss in CSV and a Danish date and time in Excel; the CSV price uses a comma as decimal separator. If format is JSON, the below applies.

Calls to or from the helplines 116111 and 1888 are only included for ADMIN users.

JSON object
offset Number Index of the first CDR record returned.
limit Number Number of CDR records to return. Note that the actual number of CDR records returned may be lower.
total Number Number of CDR records that can be returned when offset and limit is not considered. This is to be used for paging through the data.
cdr Array Array of CDR records, see definition below. When both limit and total are above 20000 the records are streamed and the array is named cdrs instead.
CDR record object (JSON)
_id Id Unique id of the CDR record.
type String Type and direction of the call: MVNO_INBOUND, MVNO_OUTBOUND.
aNumber String The number presented by the caller, E.164 format. If the type is MVNO_INBOUND and the caller is using secret number then the number will be 'HIDDEN', unless the user is ADMIN.
aNumberSecret Boolean True if aNumber is secret and not to be presented.
bNumber String The number called, E.164 format.
diverter String If the call is a diverted call, this is the E.164 number of the one who diverted the call.
start Date Date and time the call started.
length Integer The length of the call in seconds, 0 if the call was not answered.
talkLength Integer The length of the call after answer in seconds. Only present if the customer uses duration method 1.
terminationCause String The reason for the call to end:
HANGUP - call hang up
BUSY - callee is busy
NO_ANSWER - callee did not answer
BLACKLISTED - called number is blacklisted
BLOCKED - caller is not allowed to call the callee (highrate/international/all blocking)
ERROR - call failed
NOT_FOUND - callee does not exist
FRAUD - call terminated due to fraud
terminatedBy String Who terminated the call: A = caller, B = callee, S = system.
destination.country String The ISO3166-2 country code of the destination country.
destination.type String The type of destination 'fixed', 'mobile', 'special', 'dkspecial'.
destination.name String If the type is 'dkspecial', the call is towards a danish special number, 112, 114, 1813 etc., and this contains a precise description in danish of the destination (e.g. 1813 Akuttelefonen region hovedstaden).
userName String Name of the person making the call (if set by PBX).
userLocation String Location of the person making the call (if set by PBX).
userExtension String Local extension number of the person making the call (if set by PBX).
roaming Boolean True if the user was roaming while the call was made.
roamingCountry String Name of the country the user was roaming in, if roaming.
roamingRegion Id Id of the roaming region that was roamed in, if roaming.
connectionFeePrice Number Connection fee for the customer.
minutesPrice Number Price of the minutes for the customer.
price Number Total price of the call for the customer, connectionFeePrice + minutesPrice, 3 decimals.

An ADMIN receives the complete stored CDR record, which additionally holds callId, sbcServer, voiceAccount, customer, ratePlan, connectionFeeCost, connectionFeeWholesale, minutesCost, minutesWholesale, vatExemption, invoiced, roamingNetwork, accessNetworkInfo and rtpStat.

If a call originates from a PBX, then the PBX can add SIP headers to the outbound call to indicate the name of the caller, the location of the caller and the local extension number of the caller. These data will automatically be added to the CDR record if available.

Example

{
  "offset": 0,
  "limit": 100,
  "total": 548,
  "cdr": [
    {
      "_id": "650000000000000000000001",
      "type": "MVNO_OUTBOUND",
      "aNumber": "+4581808888",
      "aNumberSecret": false,
      "bNumber": "+4570305050",
      "diverter": null,
      "start": "2026-07-23T12:34:56.123Z",
      "length": 78,
      "terminationCause": "HANGUP",
      "terminatedBy": "B",
      "destination": { "country": "DK", "type": "mobile", "name": null },
      "userName": "Hans Hansen",
      "userLocation": "CPH office",
      "userExtension": "211",
      "roaming": false,
      "roamingCountry": null,
      "roamingRegion": null,
      "connectionFeePrice": 0.1,
      "minutesPrice": 0.325,
      "price": 0.425
    }
  ]
}

Errors

Error code Message Description
422 id Invalid input for the named property - the URL parameter failed validation
404 id Not found
403 access_denied Insufficient access level
422 count CDR amount exceeds the maximum - please request CDR for a shorter timeframe
500 internal_error <Unspecified>
api/mvno/account/cdr.txt · Last modified: by Mikkel Meerwaldt Jørgensen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki