Add one number
POSThttps://{ourserver.com}/api/resellers/addNumber
Adds one number to your list, unlike sendNumbersOnline, which sends the whole list. Use it to add new numbers without resending the list.
If the number is already on your list, it is replaced: the old record is removed and the number gets a new ID. The number is activated by the server within about a minute. The country code is not prepended: pass the number with it.
The request also confirms that your server is up.
Parameters
header1
| Name | Type | Description |
|---|---|---|
Authorization* | string | see more here |
Request Body
Content-Type
application/jsonSchema
schemaobject
All Of
[0]objectA number you provide.
[1]object
Examples
number
A number with a port name, not for rent
{
"number": "+46050910804",
"country_id": 46,
"date_start": 1658209063,
"port_id": "Port1",
"rent": 0
}Responses
200The number is added
Content-Type
application/jsonSchema
schemaobject
responsestringRequired
Enum:1Example:1idintegerRequired
ID of the number on our serverExample:1042Examples
success
The number is added
{
"response": "1",
"id": 1042
}400number is missing or is not a phone number, the country is unknown, equipment_id is invalid, port_id is already used by another of your numbers, or the number is online under another account
Content-Type
application/jsonSchema
schemaobjectError answer: response and message hold the same error code.
responsestringRequired
Enum:ERROR_PARAMSmessagestringRequired
Example:ERROR_PARAMS401No API key, or the key does not exist. The body is the plain text Unauthorized.
A request with Accept: application/json gets HTTP 200 with {"response":"ERROR_WRONG_KEY"} instead.
Content-Type
text/htmlSchema
schemastring
Enum:Unauthorized.Example:Unauthorized.403Forbidden: the API key is valid, but the request is refused. Error codes:
ERROR_DISABLED — the partner account is not activated;
ERROR_BANNED — the partner account is blocked;
ERROR_IP — the request comes from an IP address that is not in the account's allowlist;
ERROR_RENT — rent is requested, but the account has no rent access (addNumber only).
ERROR_DISABLED — the partner account is not activated;ERROR_BANNED — the partner account is blocked;ERROR_IP — the request comes from an IP address that is not in the account's allowlist;ERROR_RENT — rent is requested, but the account has no rent access (addNumber only).Content-Type
application/jsonSchema
schemaobject
responsestringRequired
Error codeEnum:ERROR_DISABLEDERROR_BANNEDERROR_IPERROR_RENTmessagestringRequired
The same error codeExamples
ERROR_IP
Request from an IP address outside the allowlist
{
"response": "ERROR_IP",
"message": "ERROR_IP"
}Code Samples
Generating examples...