POSThttps://{ourserver.com}/api/resellers/sendNumbersOnline

Send phone numbers in bulk to Onlinesim server list

In this request all numbers available for sale should be passed. This request should be sent to Onlinesim server every 5 minutes (to ensure that your server is up and running) and after any change in the number list: after adding new numbers or removing any of previously passed ones.

However, there is another way: you can send checkWork request every 5 minutes (as confirmation that your server is up and running), and use addNumber and removeNumber to add or delete numbers respectively.

If your server is not confirmed to be up and running (via sendNumbersOnline or checkWork) within 10 minutes, the system will consider your server unavailable and automatically remove all your numbers from issuing.

Parameters

header1
NameTypeDescription
Authorization*string

see more here

Request Body

Your server should send this request every 5 minutes as a confirmation of uptime or when the list of available numbers is changed

(when new numbers are added or previously passed ones are removed).

Content-Typeapplication/json
Schema
schemaobject
numbersobject[]
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

Example payload of your server `sendNumbersOnline` requestexample_lines
{
  "numbers": [
    {
      "number": "+234112233445",
      "country_id": 234
    },
    {
      "number": "+234112233446",
      "country_id": 234,
      "operator": 28967,
      "date_start": 1543907600
    },
    {
      "number": "+234112233447",
      "country_id": 234,
      "operator": 28967,
      "date_start": 1543907600,
      "port_id": "Port1"
    }
  ]
}

Responses

200

Onlinesim server response

Content-Typeapplication/json
Schema
schemaobject
responseoneOf

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

idsobject

Object where keys are phone numbers (in international format, e.g. "+234112233445") and values are the corresponding IDs assigned by the server

Examples

Successful Onlinesim server response example
{
  "response": 1,
  "ids": {
    "+234112233445": 1042,
    "+234112233446": 1043,
    "+234112233447": 1044
  }
}
Incorrect key passed
[
  {
    "response": "ERROR_WRONG_KEY"
  }
]
400

Bad Request

Content-Typetext/html
Schema
schemastring

Error description

Examples

Incorrect format number passed
NUMBER_FORMAT_ERROR
date_start format error
ERROR_DATE
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
schemastring
Enum:Unauthorized
403

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

Content-Typeapplication/json
Schema
schemaobject
errorobjectRequired
messagestringRequired
Enum:ERROR_DISABLEDERROR_IPERROR_RENT
detailsobject[]Required

Code Samples

Generating examples...