v2

Get the data and status of several numbers

GEThttps://{ourserver.com}/api/resellers/checkNumbers

Like checkNumber, but for several numbers. The answer has one of two shapes:

  • without numbers — all your numbers (including those connected through equipment): an object keyed by phone number, plus "response": "1";
  • with numbers — an object keyed by each requested number (as digits): the data of the number with "response": "1", or {"response": "0"} if you have no such number. There is no top-level response. With with_history, history entries here carry all fields of the operation, including the received SMS (messages).

The request also confirms that your server is up.

Parameters

query4
NameTypeDescription
numbers[]string[]

Numbers to check, with the country code (an optional leading + is ignored). Can also be passed as a numbers array in a JSON body.

with_historyboolean

Adds your completed operations on each number to history. Works by its presence: any value, even 0, turns it on.

as_textboolean

Returns used_service and banned_service as comma-separated strings. Works by its presence.

teststring

Test mode. It can also be passed in the request body.

  • test1 — the request is executed and answered as usual, but its database changes are rolled back. Effects outside the database still happen.
  • test2 — the request is not executed: the answer is a debug dump (HTML, HTTP 200) of the request headers and body as our server received them.

A request with any non-empty test value does not confirm that your server is up.

Enum:test1test2
header1
NameTypeDescription
Authorization*string

see more here

Responses

200The data of the numbers, keyed by phone number
Content-Typeapplication/json
Schema
schemaobject
responsestring
Only without numbersEnum:1Example:1
[additionalProperties]oneOf

Examples

allNumbers25 lines

Without numbers: all your numbers

{
  "4605091080": {
    "id": 110251,
    "balance": 0,
    "country_id": 46,
    "errors": 0,
    "number": "4605091080",
    "port_id": "Port1",
    "equipment_id": "2130706433",
    "sum": 26,
    "used_service": {
      "telegram": "tg"
    },
    "banned_service": {},
    "history": [],
    "banned": false,
    "reseller_id": 12345,
    "rent": "no",
    "status": 1,
    "status_text": "work",
    "clearable": true,
    "created_at": "2024-06-11T14:33:26.000000Z"
  },
  "response": "1"
}
requestedNumbers29 lines

With numbers: one number found, one not

{
  "15555555555": {
    "id": 110252,
    "balance": 0,
    "country_id": 1,
    "errors": 4,
    "number": "15555555555",
    "port_id": "Port2",
    "equipment_id": "2130706433",
    "sum": 0,
    "used_service": {},
    "banned_service": {
      "whatsapp": "wa",
      "telegram": "tg"
    },
    "history": [],
    "banned": true,
    "reseller_id": 12345,
    "rent": null,
    "status": 1,
    "status_text": "work",
    "clearable": false,
    "created_at": "2024-06-01T09:00:00.000000Z",
    "response": "1"
  },
  "15555555556": {
    "response": "0"
  }
}
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...