api:sip:voiceusage
Table of Contents
API : SIP Voice Usage
Introduction
This request will return Voice usage data for the SIP account.
Request
| URL | https://api.telecomx.dk/sip/ACCOUNT_ID/voiceUsage | |
|---|---|---|
| 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 SIP account (24 hex-char string). |
| Query | fromDate | [optional] Date to start from. Date format: yyyy-mm-dd. Defaults to today. |
| toDate | [optional] Last date to return records for. Date format: yyyy-mm-dd. |
|
Query example
https://api.telecomx.dk/sip/1234567890ABCDEF12345678/voiceUsage https://api.telecomx.dk/sip/1234567890ABCDEF12345678/voiceUsage?fromDate=2014-07-23 https://api.telecomx.dk/sip/1234567890ABCDEF12345678/voiceUsage?fromDate=2014-07-23&toDate=2014-07-31
Response
The response is an array of JSON objects.
| JSON object | ||
|---|---|---|
| date | Date | The date the usage relates to. |
| callsIn | Number | Number of inbound calls. |
| callsOut | Number | Number of outbound calls. |
| secsIn | Number | Total number of seconds for inbound calls. |
| secsOutHomeland | Number | Total number of seconds for outbound calls towards homeland destinations. |
| secsOutEuNordic | Number | Total number of seconds for outbound calls towards EU and Nordic destinations. |
| secsOutRestOfEurope | Number | Total number of seconds for outbound calls towards the rest of Europe and Thailand. |
| secsOutWorld1 | Number | Total number of seconds for outbound calls towards world region 1. |
| secsOutWorld2 | Number | Total number of seconds for outbound calls towards world region 2. |
| secsOutWorld3 | Number | Total number of seconds for outbound calls towards world region 3. |
| cost | Number | Total cost of the calls (ADMIN only). |
| wholesale | Number | Total reseller price for the calls (RESELLER/ADMIN only). |
| price | Number | Total price for the calls. |
Example
[ { date: '2015-01-01T00:00:00.000Z', callsIn: 535, callsOut: 243, secsIn: 65346, secsOutHomeland: 54272, secsOutEuNordic: 2432, secsOutRestOfEurope: 0, secsOutWorld1: 0, secsOutWorld2: 421, secsOutWorld3: 0, cost: 123.00, wholesale: 234.00, price: 360.00 }, { ... } ]
Errors
| Error code | Message | Description |
|---|---|---|
| 400 | bad_request | SIP 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/sip/voiceusage.txt · Last modified: 2015/07/26 14:00 by Per Møller