User Tools

Site Tools


api:number:list

API : Number List

Introduction

This request will return a list of phone numbers.

Request

URL https://api.telecomx.dk/number
Method GET
Access level VIEWER, MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller or a sub reseller.
ADMIN.
Query list The type of numbers list to return:
SIP_AVAILABLE - Return fixed and international numbers that belongs to a customer and is not in use.
SIP_PURCHASE - Return fixed and international numbers that are available for purchase.
MVNO_AVAILABLE - Return mobile numbers that belongs to a customer and is not in use.
MVNO_AVAILABLE_TELENOR - Return mobile numbers on Telenor net that belongs to a customer and is not in use.
MVNO_AVAILABLE_TDC - Return mobile numbers on TDC net that belongs to a customer and is not in use.
MVNO_PURCHASE - Return mobile numbers that are available for purchase.
MVNO_PURCHASE_TELENOR - Return mobile numbers on Telenor net that are available for purchase.
MVNO_PURCHASE_TDC - Return mobile numbers on TDC net that are available for purchase.
CUSTOMER_ALL - Return all numbers that belongs to the customer.
PRE_RESERVED - Return numbers that the reseller has pre reserved for customers. Only available for RESELLERs.
PORTING - Return numbers that are part of a porting.
VOICE_ACCOUNT - Return numbers that are used by a voice account (SIP or MVNO).
ADMIN - Return numbers as defined by the search criterias below.
customer [optional] Id of customer, required for list types: SIP_AVAILABLE, MVNO_AVAILABLE, CUSTOMER_ALL and optional for list type ADMIN. If set set for required list types, the users own customer is autoselected.
filter [optional] A phone number of part of it.
porting Id of a porting the numbers must be part of. Used with list type PORTING or ADMIN.
voiceAccount Id of a voice account the numbers must be part of. Used with list type VOICE_ACCOUNT or ADMIN.
employee Id of an employee who is registered as the user of the number(s). Used with list type ADMIN.
reseller Id of a reseller who has pre preserved the number(s). Used with list type ADMIN.
state State of the number:
AVAILABLE - can be assigned by OWNER/RESELLER/ADMIN at the set price. If a customer is already set, then it is only available to that customer.
LOCKED - cannot be assigned.
IN_USE - assigned to a voice account and in use.
IN_USE_DATASHARING - assigned to an account for datasharing sim, see simNumber
IN_USE_SMARTWATCH - assigned to an account for smartwatch sim, see simNumber
PORTING_IN - currently being ported in.
PORTING_OUT - currently waiting to be ported out.
OUT_PORTED has been outported.
CLOSED was in use, now in 6 month wait period before it available again.
PRE_RESERVED - reserved by a reseller for a potential customer, will timeout in 14 days.
Used with list type ADMIN.
type Type of number:
FIXED - landline number.
INTERNATIONAL - Non danish number.
MVNOTELENOR - Mobile phone number on Telenor network.
MVNOTDC - Mobile phone number on TDC network.
Used with list type ADMIN.
rangeOwner True if the number(s) must be part of a series that Telecom X is responsible for. Used with list type ADMIN.
offset [optional] Index of the first porting to return, default 0.
limit [optional] The number of porting to return, default 100, min 1, max 500.
full [optional] If true, complete number objects will be returned instead of the condensed versions.
partOfRange [optional] True to only include numbers as part of a number range, false to only include numbers that are not part of a range. Used with list type SIP_PURCHASE, SIP_AVAILABLE

Query examples

https://api.telecomx.dk/number?list=SIP_AVAILABLE&customer=1234567890ABCDEF12345678
https://api.telecomx.dk/number?list=PORTING&porting=1234567890ABCDEF12345678&full=true
https://api.telecomx.dk/number?list=SIP_PURCHASE&filter=+457030&offset=100&limit=100
https://api.telecomx.dk/number?list=ADMIN&filter=+4570&state=IN_USE&type=FIXED&rangeOwner=true

Response

JSON object
offset Index of the first number returned.
limit Number of numbers to return. Note that the actual number of numbers returned may be lower.
total Number of numbers that can be returned when offset and limit is not considered. This is to be used for paging through the data.
numbers Array of numbers, see definition below.
Number object (JSON)
_id String The phone number in E.164 format.
state String State of the number:
AVAILABLE - can be assigned by OWNER/RESELLER/ADMIN at the set price. If a customer is already set, then it is only available to that customer.
LOCKED - cannot be assigned.
IN_USE - assigned to a voice account and in use.
IN_USE_DATASHARING - assigned to an account for datasharing sim, see simNumber
IN_USE_SMARTWATCH - assigned to an account for smartwatch sim, see simNumber
PORTING_IN - currently being ported in.
PORTING_OUT - currently waiting to be ported out.
OUT_PORTED has been outported.
CLOSED was in use, now in 6 month wait period before it available again.
PRE_RESERVED - reserved by a reseller for a potential customer, will timeout in 14 days.
type String Type of number:
FIXED - landline number.
INTERNATIONAL - Non danish number.
MVNOTELENOR - Mobile phone number on Telenor network. MVNOTDC - Mobile phone number on TDC network.
wholesale Number The price of purchasing the number for the reseller. Only available for RESELLERs and ADMINs. If the number is part of a series, this is the resellers price for the whole series.
price Number The price of purchasing the number for the customer. If the number is part of a series, this is the price for the whole series, as the number can only be purchased together with the whole series.
range String If the number is part of a range and should only be assigned/sold as a range, then this is a string of first number a dash and the last number (e.g. +4570305050-+4570305059), only valid for fixed line.
voiceAccount Id If the number belongs to a voiceAccount, this is the ID of the account.
voiceAccountName String If the number belongs to a voiceAccount, this is the name of the account.
employee Id If the number is being used by a specific employee, this is the ID of the employee.
name String If the number is being used by a specific employee this is the name of the employee, otherwise it can be the name of a location or function.
porting Id If the number is being ported, this is the ID of the porting it is part of.
portingStatusStage String The current stage of the porting the number is part of: IN_CREATED, IN_AWAITING_POA_FROM_CUSTOMER, IN_POA_RECEIVED_FROM_CUSTOMER, IN_POA_SENT, IN_ORDERED, IN_CONFIRMED, IN_REJECTED, IN_DONOR_CONTACTED, IN_COMPLETED, IN_CANCELLED, OUT_RECEIVED, OUT_CONFIRMED, OUT_RECEIVER_CONTACTED, OUT_COMPLETED, OUT_CANCELLED, OUT_REJECTED.
portingStatusDate Date If the number is being ported - date when the current porting stage was entered.
rangeOwner Boolean True if the number is part of an range that originally was assigned to Telecom X by Erhvervsstyrelsen, only applies to list type ADMIN.
preReserved Date If state is PRE_RESERVED this is the date when the pre-reservation expires.
preReservedBy Id If state is PRE_RESERVED and list is ADMIN, this is the ID of the reseller who has pre-reserved the number.
preReservedByName String If state is PRE_RESERVED and list is ADMIN, this is the name of the reseller who has pre-reserved the number.
product Id Id of “NUMBER_RENT” product, overrides the customer's number rent product for this number.
simNumber String ICC number of datasharing sim card that this number is in use o (state IN_USE_DATASHARING only).
Number object if full=true (JSON)
_id String The phone number in E.164 format.
state String State of the number:
AVAILABLE - can be assigned by OWNER/RESELLER/ADMIN at the set price. If a customer is already set, then it is only available to that customer.
LOCKED - cannot be assigned.
IN_USE - assigned to a voice account and in use.
IN_USE_DATASHARING - assigned to an account for datasharing sim, see simNumber
IN_USE_SMARTWATCH - assigned to an account for smartwatch sim, see simNumber
PORTING_IN - currently being ported in.
PORTING_OUT - currently waiting to be ported out.
OUT_PORTED has been outported.
CLOSED was in use, now in 6 month wait period before it available again.
PRE_RESERVED - reserved by a reseller for a potential customer, will timeout in 14 days.
type String Type of number:
FIXED - landline number.
INTERNATIONAL - Non danish number.
MVNOTELENOR - Mobile phone number on Telenor network.
MVNOTDC - Mobile phone number on TDC network.
voiceAccount Id Id of the voice account (SIP/MVNO) using it, if state is IN_USE.
customer Id Id of customer who owns it, if state is IN_USE, PORTING_IN, PORTING_OUT or AVAILABLE).
employee Id Id of employee using the number, if known and state is IN_USE, PORTING_IN or PORTING_OUT. Used for identifying the daily user of the number, e.g. in billing.
name String Daily user and/or department, if employee is not used and state is IN_USE, PORTING_IN or PORTING_OUT. Used for identifying the daily user/role of the number, e.g. in billing.
rangeOwner Boolean True if the number is part of an range that originally was assigned to Telecom X by Erhvervsstyrelsen.
range String If the number is part of a range and should only be assigned/sold as a range, then this is a string of first number a dash and the last number (e.g. +4570305050-+4570305059), only valid for fixed line. If the number is an MVNO number, then the series must be split into single numbers by an ADMIN before they can be used for MVNO accounts.
porting ObjectID If the number is part of a porting and state is PORTING_IN or PORTING_OUT, then this is the id of the porting.
live Date The date and time this number went live (state changed to IN_USE).
closed Date If state is CLOSED, this is the date the number was closed. A closed number will remain closed for 6 months before it is released for re-use.
preReserved Date If state=PRE_RESERVED this is the date it was pre-reserved. Pre-reservations lasts for 14 days before the number is released again.
preReservedBy Id Id of the reseller who has pre-reserved the number and is the only one who can release it or assign it to a customer.
wholesale Number The price of purchasing the number for the reseller. Only available for RESELLERs and ADMINs. If the number is part of a series, this is the resellers price for the whole series.
price Number The price of purchasing the number for the customer. If the number is part of a series, this is the price for the whole series, as the number can only be purchased together with the whole series.
listed Boolean True if the number should be listed in public phone books and number lookup services.
product Id Id of “NUMBER_RENT” product, overrides the customer's number rent product for this number.
simNumber String ICC number of datasharing sim card that this number is in use o (state IN_USE_DATASHARING only).

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

Example - normal

{
  offset: 100,
  limit: 50,
  total: 999,
  numbers:
  [
    {
      _id: '+4570305050',
      state: 'IN_USE',
      type: 'FIXED',
      wholesale: 8000.00,
      price: 10.000,
      product: '1234567890ABCDEF12345678'
    },
    {
      ...
    }
  ]
}

Example - full=true

{
  offset: 0,
  limit: 100,
  total: 10000,
  customers:
  [
    {
      _id: '+4570305050',
      state: 'IN_USE',
      type: 'FIXED',
      voiceAccount: '1234567890ABCDEF12345678',
      customer: '1234567890ABCDEF12345677',
      employee: '1234567890ABCDEF12345679',
      name: null,
      rangeOwner: true,
      range: '+4570305050-+4570305059',
      porting: null,
      live: '2014-01-01T12:34:56.789Z',
      closed: null,
      preReserved: null,
      preReservedBy: null,
      wholesale: 8000.00,
      price: 10000.00,
      listed: true,
      product: '1234567890ABCDEF12345678'
    },
    {
      ...
    }
  ]
}

Errors

Error code Message Description
422 list List type is not valid
404 customer Customer not found
404 porting Porting not found
404 voiceAccount Voice account not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/number/list.txt · Last modified: 2025/12/03 12:20 by Mikkel Frederiksen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki