User Tools

Site Tools


api:number:create

API : Number Create

Introduction

This request will create a number or a series of numbers.

This is used by an ADMIN to add number series purchased from Erhvervsstyrelsen or international numbers. When adding series, a max of 1000 numbers can be part of a series.

Request

URL https://api.telecomx.dk/number
Method POST
Access level RESELLER_ADMIN with PORTING feature, or ADMIN.
Body _id String If creating a single number - then the phone number in E.164 format. If creating a series, then the first number, a dash, and the last number in E.164 format (e.g. +4570305050-+4570305059). A series must be 10,20,30,40,50,60,70,80,90,100,200,300,400,500,600,700,800,900,1000 numbers.
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
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.
customer Id Id of customer who owns it, if state is IN_USE, PORTING_IN, PORTING_OUT or AVAILABLE).
rangeOwner Boolean True if the number is part of an range that originally was assigned to Telecom X by Erhvervsstyrelsen.
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.
product ObjectID Id of “NUMBER_RENT” product, overrides the customer's number rent product for this number.

Query example

{
  _id: '+4570305000-+4570305999',
  state: 'LOCKED',
  type: 'FIXED',
  customer: null,
  rangeOwner: true,
  wholesale: 90000.00,
  price: 100000.00,
  product: '1234567890ABCDEF12345678'
}

Response

JSON object
success Boolean True on success.
count Integer Number of numbers created.

Example

{
  success: true,
  count: 1000
}

Errors

Error code Message Description
400 bad_request Number not found in body of request
422 _id Id does not contain a valid number or range of numbers
422 state Numbers can only be added with the state AVAILABLE or LOCKED
404 product Product not found
409 _id One or more of the numbers already exists
409 _id The number already exists
422 _id Number is not a valid E.164 number
422 type Type is not valid
422 series Size of number series is invalid
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/number/create.txt · Last modified: 2023/10/30 20:45 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki