api:mvno:datausage
Table of Contents
API : MVNO Data Usage
Introduction
This request will return data usage for the MVNO account. Data usage is registed in chunks, not pr. day, so multiple records may cover a single day.
Request
| URL | https://api.telecomx.dk/mvno/ACCOUNT_ID/dataUsage | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
|
| Param | ACCOUNT_ID | Id of the MVNO account (24 hex-char string). |
| Query | fromDate | [optional] Date to start from. Date format: yyyy-mm-dd. Defaults to first of month. |
| toDate | [optional] Last date to return records for. Date format: yyyy-mm-dd. Defaults to now. |
|
| region | [optional] ID of a specific region to only return usage for |
|
Query example
https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/dataUsage https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/dataUsage?fromDate=2014-07-23 https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/dataUsage?fromDate=2014-07-23&toDate=2014-07-31 https://api.telecomx.dk/mvno/1234567890ABCDEF12345678/dataUsage?fromDate=2014-07-23&toDate=2014-07-31®ion=2234567890ABCD1234567890
Response
The response is an object with an array with mvnoData, and groupedData, a nested map (object-of-objects).
| JSON object | ||
|---|---|---|
| mvnoData | Array | Mvno data usage |
| mvnoData[].date | Date | Date and time the usage occured. |
| mvnoData[].bytes | Number | Bytes of data used |
| mvnoData[].roaming | Boolean | True if user was roaming while using the data |
| mvnoData[].roamingCountry | String | Country the roaming took place in |
| mvnoData[].roamingNetwork | String | Name of the network operator that was roamed on |
| mvnoData[].region | ObjectId | ID of roaming region that was roamed in, if roaming. |
| mvnoData[].cost | Number | Cost (regardless of subscription, ADMIN only). |
| mvnoData[].wholesale | Number | Reseller price (regardless of subscription, RESELLER/ADMIN only). |
| mvnoData[].price | Number | Price of usage (regardless of subscription). |
| groupedData | Object | Aggregated data usage by roaming country and day (in GB). Keys are dynamic. |
| groupedData.<country> | Object | Map for a single roaming country (country name from getCountryName(roamingCountry)). |
| groupedData.<country>.<dayKey> | Number | Total usage for that country on that day, in GB (converted from summed bytes). |
Example
{ mvnoData: [ { date: ISODate('2025-12-07T10:15:00.000Z'), bytes: 1342177280, roaming: true, roamingCountry: 'DE', roamingNetwork: 'Telekom.de', region: ObjectID('6560d9d7b5c1a2f0d6c3e111'), cost: 15.00, wholesale: 18.20, price: 25.50 }, { date: ISODate('2025-12-08T09:05:00.000Z'), bytes: 2147483648, roaming: true, roamingCountry: 'SE', roamingNetwork: 'Telia', region: ObjectID('6560d9d7b5c1a2f0d6c3e222'), cost: 23.10, wholesale: 28.50, price: 40.00 } ], groupedData: { Tyskland: { '07/12-2025': 1.25 }, Sverige: { '08/12-2025': 2.00 } } }
Errors
| Error code | Message | Description |
|---|---|---|
| 400 | bad_request | MVNO account id not found in request URI |
| 403 | access_denied | Insufficient access level |
| 422 | toDate | To date is before from date |
| 409 | toDate | The date span is roo large, max 1 year |
api/mvno/datausage.txt · Last modified: 2025/12/12 11:36 by Thomas Andersen