User Tools

Site Tools


api:sip:check_numbers

API : SIP Account Check Numbers

Introduction

This request will check a list of numbers and return their current state. This should be used by UI when adding numbers to a SIP trunk, so that the user may be presented with the current state of all the numbers she wish to add to the SIP account.

A SIP account will accept any E.164 formatted phone number, and report the status as to if the number is available, in use, needs to be purchased or perhaps needs to be ported.

Request

URL https://api.telecomx.dk/sip/check/numbers
Method POST
Access level VIEWER, MANAGER or OWNER when user belongs to the customer.
RESELLER if customer belongs to the reseller.
ADMIN.
Body Customer Id Id of the customer the numbers are to be added to.
id Id [optional] Id of the SIP account (if it exists yet).
numbers Array Array of E.164 formatted phone numbers to check.

Query example

{
  customer: '1234567890ABCDEF12345678',
  id: '1234567890ABCDEF12345678',
  numbers:
  [
    '+4570305050',
    '+4570305051',
    '+4570305052',
    '+4570305053',
    '+4570305054',
    '+4581808888',
    '+4540301234',
  ]
}

Response

An array of objects each describing the state of the check number.

A checked number (JSON object)
number String The checked number, E.164 formatted.
status String The status of the number: see status descriptions below.
price Double If status = AVAILABLE_FOR_PURCHASE, then this is the price to purchase the number. If the number is part of a series, each number in the series will have the same price, but only the first number in the series will be the one to pay for, although you cannot buy part of a series.
wholesale Double If status = AVAILABLE_FOR_PURCHASE, then this is the price the reseller will pay to Telecom X for the number or number-series. This is only available if user is a RESELLER.
range String If the number is part of a series, this will contain the first number a dash and the last number of the series.
currentOperator String If status = PORTING_REQUIRED, this is the CPS code of the operator where the number is currently located.
currentOperatorName String If status = PORTING_REQUIRED, this is the name of the operator where the number is currently located.
employee Id If the number is in porting or in use, and has been assigned to an employee, this is the id of the employee.
employeeName String If the number is in porting or in use, and a name has been assigned to it, then this is the name. If an employee has been assigned to it, then this is the name of the employee.
Status code Description
RESERVED The customer owns the number and it can be assigned to the account.
IN_PORTING_THIS_ACCOUNT Number is being ported in, and is already part of the SIP account.
IN_USE_THIS_ACCOUNT Number is in use by the SIP account.
IN_PORTING_OTHER_ACCOUNT Number is being ported in, but belongs to another SIP account.
IN_USE_OTHER_ACCOUNT Number is in use by another SIP account.
AVAILABLE_FOR_PURCHASE Number is available and will be purchased for the price shown in price if added to the account. The resellers wholesale price will also be available if the user is a reseller.
PORTING_REQUIRED The number is located at another Telecom Service Provider and needs to be ported in before it can be used. If the number is added to the SIP trunk a porting will automatically be created. The CPS code and name of the other TSP can be seen in currentOperator and currentOperatorName.
UNAVAILABLE The number is not available (somebody else is using it or it is not for sale).
WRONG_TYPE The number is a mobile number, only landline numbers can be added to a SIP trunk.
INVALID The number is invalid or an international number that needs to be handled manually before it can be added to a SIP account.

Note that properties holding no value may be omitted from the object.

Example

[
  {
    number: '+4570305050',
    status: 'AVAILABLE_FOR_PURCHASE',
    price: 10000.00,
    wholesale: 9000.00,
    range: '+4570305050-+4570305099',
    currentOperator: null,
    currentOperatorName: null,
    employee: null,
    employeeName: null
  }
  ...
]

Errors

Error code Message Description
403 access_denied Insufficient access level
422 customer Customer not found
422 id SIP account id invalid
422 numbers Numbers to check not found
422 numbers One or more numbers are not valid E.164 formatted
500 internal_error <Unspecified>
api/sip/check_numbers.txt · Last modified: 2014/10/05 11:00 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki