post{yourserver}/getServices

POST /getServices

Get list of available services and countries

This request is sent from Onlinesim server to yours every minute to get a quantity of available numbers. Your server should return a relevant list of available numbers in format described below.

Your partner's API key will be passed in the request in a payload.

Parameters

header1
NameTypeDescription
Authorization*string

see more here

Request Body

Request payload from Onlinesim server

Content-Typeapplication/json
Schema
Bodyobject
actionstringRequired

Method name, in this case GET_SERVICES

Enum:GET_SERVICESDefault:GET_SERVICES
keystringRequired

API key of your Onlinesim partner's profile

Examples

Example payload of Onlinesim server GET_SERVICES request
{
  "action": "GET_SERVICES",
  "key": "apikey"
}

Responses

200

The response of your server for GET_SERVICES request must be in following format:

Content-Typeapplication/json

Headers

NameTypeDescription
Content-Typestring

Content type header and encoding scheme

Schema
Responseobject
countryListobject[]Required

List of countries and the respective available number counts per operator and service

itemsobject
countrystringRequired

An object whose keys are country names, as specified in the country list

operatorMapobjectRequired

An object where each key is an operator name according to the operator list. The any key is required and must contain the total number of numbers across all operators for each service

anyobjectRequired

Total number of numbers for all operators for each service. For the "SMS receiving" service, the keys are service names according to the service list; for the "Rental" service, the key is rent

[additionalProperties]integer

Number of available numbers for this service (or rent)

≥ 0
[additionalProperties]object

Data on the number of numbers for a specific operator (not any). Keys are service names according to the service list, for the "Rent" service – the key is rent

[additionalProperties]integer

Number of available numbers for this service with this operator

≥ 0
statusstringRequired

Request status (SUCCESS or ERROR)

Enum:SUCCESSERROR

Examples

Response example from your server50 lines
{
  "countryList": [
    {
      "country": "russia",
      "operatorMap": {
        "any": {
          "vk": 10,
          "ok": 25,
          "wa": 52
        },
        "beeline": {
          "vk": 10,
          "ok": 15,
          "wa": 20
        },
        "megafon": {
          "vk": 0,
          "ok": 10,
          "wa": 32
        }
      }
    },
    {
      "country": "ukraine",
      "operatorMap": {
        "any": {
          "vk": 10,
          "ok": 50,
          "wa": 132
        },
        "life": {
          "vk": 0,
          "ok": 10,
          "wa": 32
        },
        "vodafone": {
          "vk": 10,
          "ok": 10,
          "wa": 0
        },
        "kyivstar": {
          "vk": 0,
          "ok": 30,
          "wa": 100
        }
      }
    }
  ],
  "status": "SUCCESS"
}

Code Samples

Generating examples...