posthttps://{ourserver.com}/api/resellers/addNumber

POST /api/resellers/addNumber

Forward specified phone numbers to Onlinesim server

This request allows you to add numbers to the Onlinesim server by one at a time, on the contrary to sendNumbersOnline that sends all active numbers as a list.

This could be especially useful if you need to add new numbers to the list of existing ones, instead of passing the modified list every time when you add new numbers.

Parameters

header1
NameTypeDescription
Authorization*string

see more here

Request Body

Adding new numbers to the list of existing ones on Onlinesim server.

Content-Typeapplication/json
Schema
Bodyobject

Payload schema

All Of
[0]object
numberstringRequired

Phone number in international format

country_idintegerRequired

Country code (according to countries list)

operatorinteger

MCC + MNC operator code (first 5 digits of IMSI)

date_startinteger

Date and time of the start of the phone number placement in UNIX timestamp format

Format:date-time
port_idstring

Unique port name, this name will be displayed in our interface on your personal web-page. Unless specified defaults to phone number value (value of number parameter)

maxLen: 100
usedstring[]
itemsstring

List of services to mark this number as used. Pass values from the Service column of the services table (e.g. vkcom, tg, google).

Server caches this value for about a week from the last time it was passed and uses it when the number is activated. Any repeated request with this parameter resets the cache and starts a new countdown.

If used is not passed in the request, server will use previously cached value (if any). To clear the cache, pass an empty array [].

rentintegerRequired

Rent mode for this number:

1 - enabled,

0 - disabled

Enum:01
[1]object
teststring

Optional field for the request body of Reseller API v2. Allowed values are test1, test2.

While being assigned, test1 value will allow the request to be passed, however the data won't be saved by our server (the function will not be executed by this request).

While being assigned, test2 value will print out your request's payload in response.

Can be passed as query parameter (for GET) or as a field in request's body (for POST). Both ways are equivalent, but using them simultaneously is not recommended.

Enum:test1test2

Examples

Payload example for `addNumber` from your server
{
  "number": "+46050910804",
  "country_id": 46,
  "operator": 24012,
  "date_start": 1658209063,
  "port_id": "Port1",
  "rent": 0,
  "test": "test1"
}

Responses

200

Onlinesim server response

Content-Typeapplication/json
Schema
Responseobject
responseoneOf

1, if request was successful, otherwise error message will come up

One Of
[0]string
[1]integer
idinteger

Phone number and their respective IDs: id - returns id for each existing number (or assigns id for new ones) or assigns null for removed numbers

Examples

Onlinesim server response example (successfuly added new numbers)
{
  "response": 1,
  "ids": {
    "+234112233445": 1042,
    "+234112233446": 1043,
    "+234112233447": 1044
  }
}
Incorrect key passed
[
  {
    "response": "ERROR_WRONG_KEY"
  }
]
400

Missing or incorred parameters (request must contain parameters in it's body with proper names as described in documentation)

Content-Typeapplication/json
Schema
Responseobject
responsestringRequired
Enum:ERROR_PARAMS
messagestringRequired
401

Unauthorized. The request is missing or uses an invalid API key. Some endpoints may return a 200 status with an ERROR_WRONG_KEY message instead of 401 — check the response body

Content-Typetext/plain
Schema
Responsestring
Enum:Unauthorized
403

Forbidden. The request was understood but refused due to insufficient permissions

Content-Typeapplication/json
Schema
Responseobject
errorobjectRequired
statusinteger

HTTP response code in text format

codestring
messagestring

Possible error codes: - ERROR_DISABLED - partner account is not activated - ERROR_IP - IP address is not in the list of allowed addresses - allowlist (see Access from IP field) - ERROR_RENT - account has no access to rent

Enum:ERROR_DISABLEDERROR_IPERROR_RENT
messagestringRequired
Enum:ERROR_DISABLEDERROR_IPERROR_RENT
detailsobject[]Required
itemsobject

Code Samples

Generating examples...