api:voiceaccount
Table of Contents
API : SIP account Get
Introduction
This request will return a voice account if found. A voice account can be either a SIP account or a MVNO account.
This request is used when you want to lookup the account for a given id or for a given phone number.
Request
| URL | https://api.telecomx.dk/voiceaccount/ID | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
|
| Param | ID | Id of the SIP/MVNO account (24 hex-char string) or a phone number that belongs to the account (E.164 format). |
| Query | basics | If true, only _id, customer, name, active, type, deviceType, sipAccount, pbx, extension and numbers are returned. |
| pbx | If true, only type, pbx and extension is returned (used to check if a phone number is usable for hosted PBX). | |
Query example
https://api.telecomx.dk/voiceaccount/1234567890ABCDEF12345678 https://api.telecomx.dk/voiceaccount/+4570305050
Response
| Json object | ||
|---|---|---|
| _id | Id | Unique SIP account id. |
| customer | Id | Id of customer the SIP account belongs to. |
| active | Boolean | True if the account is active and can handle calls. |
| name | String | Human readable name of the SIP account, or the first number of the account. |
| type | String | Type of account - 'SIP' or 'MVNO'. |
| numbers | Array | Array of numbers that the account handles in E.164 format. |
| sipAccount | Id | Id of the SIP account (sip trunk) all calls are routed through (if used) (MVNO only). |
| pbx | Number | Id of hosted PBX cluster to use, null or 0 if not part of hosted PBX. |
| extension | Id | Id of extension the account belongs to on the hosted PBX (only MVNO and if pbx>0). |
Note that properties holding no value may be omitted from the object.
Example
{ _id: '1234567890ABCDEF12345678', customer: '1234567890ABCDEF12345678', active: true, name: 'Primary trunk CPH', type: 'SIP', numbers: ['+4570305050','+4570305051','+4570305052','+4580808080'], pbx: 1 }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | not_found | Voice account not found |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified error> |
api/voiceaccount.txt · Last modified: 2016/02/05 08:42 by Per Møller