v2

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
NameTypeDescription
Authorization*string

see more here

Request Body

Content-Typeapplication/json
Schema
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-Typeapplication/json
Schema
schemaobject
responsestringRequired
Enum:1Example:1
idintegerRequired
ID of the number on our serverExample:1042

Examples

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-Typeapplication/json
Schema
schemaobjectError answer: response and message hold the same error code.
responsestringRequired
Enum:ERROR_PARAMS
messagestringRequired
Example:ERROR_PARAMS
401No 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-Typetext/html
Schema
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).
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error codeEnum:ERROR_DISABLEDERROR_BANNEDERROR_IPERROR_RENT
messagestringRequired
The same error code

Examples

ERROR_IP

Request from an IP address outside the allowlist

{
  "response": "ERROR_IP",
  "message": "ERROR_IP"
}

Code Samples

Generating examples...