api:number:update
Table of Contents
API : Number Update
Introduction
This request will update a number or a series of numbers.
Depending on the users access level, different properties may be updated:
| Access level | Properties |
|---|---|
| MANAGER | employee, name, listed |
| OWNER | employee, name, listed |
| RESELLER | employee, name, listed |
| ADMIN | state, type, customer, rangeOwner, closed, preReserved, preReservedBy, wholesale, price, listed |
Request
| URL | https://api.telecomx.dk/number/NUMBER_ID | ||
|---|---|---|---|
| Method | POST | ||
| Access level | MANAGER or OWNER if belonging to the numbers customer. RESELLER if customer who owns the numbers belongs to the reseller. ADMIN. |
||
| Params | NUMBER_ID | The number to update (E.164 format) or if updating a range, then the first number of the range (E.164 format). | |
| Body | _id | String | If updating a single number - then the phone number in E.164 format. If updating a series, then the first number, a dash, and the last number in E.164 format (e.g. +4570305050-+4570305059). |
| state | String | State of the number(s): 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(s): 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). | |
| 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. | |
| live | Date | If state is IN_USE, PORTING_IN or PORTING_OUT, this is the date the number was taken into 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. | |
Query example
{
_id: '+4570305000-+4570305999',
state: 'AVAILABLE',
}
| JSON object | ||
|---|---|---|
| _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 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. |
| 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 | ObjectID | 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
{ _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: '1234567890ABCEF12345678', simNumber: null }
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 | _id | Range too big, max. 1000 numbers in a range |
| 409 | range | Cannot update part of a range or multiple ranges, must always update a single number or a single range |
| 422 | _id | Number is not a valid E.164 number |
| 422 | type | Type is not valid |
| 422 | range | Range is invalid |
| 422 | live | Live date is required for state IN_USE |
| 422 | live | Live date is required for state PORTING_OUT |
| 422 | closed | Closed date is required for state CLOSED |
| 422 | preReserved | Pre reserved date is required for state PRE_RESERVED |
| 422 | state | State is not valid |
| 404 | voiceAccount | Voice account not found |
| 404 | porting | Porting not found |
| 404 | employee | Employee not found |
| 404 | preReservedBy | Pre reserving reseller not found |
| 404 | product | Product not found |
| 409 | range | Range is invalid, all the numbers in the range does not belong to the range |
| 409 | state | State cannot be changed at its current state, the voice accounts must instead be deleted |
| 409 | number | Numbers cannot be used within 90 days of it being closed |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/number/update.txt · Last modified: 2023/06/14 09:50 by Per Møller