v1

Get list of available services and countries

POST{yourserver}/getServices

This request is sent from the OnlineSIM server to yours every minute to get the number of available numbers. Your server should return the current counts in the format described below.

All v1 requests are JSON POST requests (Content-Type: application/json) to the single URL of your integration; the method is passed in the action field, your partner API key in the key field. No Authorization header is sent. Only the JSON body of your answer is read; its HTTP status code is not checked.

Request Body

Request payload from the OnlineSIM server

Content-Typeapplication/json
Schema
schemaobject
actionstringRequired
Method name, in this case GET_SERVICESEnum:GET_SERVICESExample:GET_SERVICES
keystringRequired
API key of your OnlineSIM partner profileExample:apikey

Examples

request

GET_SERVICES request from the OnlineSIM server

{
  "action": "GET_SERVICES",
  "key": "apikey"
}

Responses

200The answer of your server to GET_SERVICES
Content-Typeapplication/json
Schema
schemaobject
countryListobject[]List of countries with the number of available numbers per operator and service. Countries and services OnlineSIM does not know are ignored; negative counts are read as 0.Example:[ { "country": "russia", "operatorMap": { "any": { "vk": 10, "ok": 25, "wa": 52 } } } ]
statusstringRequired
SUCCESS with a non-empty countryList; NO_PROVIDER - nothing to offer now (not counted as an error); any other value is an errorEnum:SUCCESSNO_PROVIDERERRORExample:SUCCESS

Examples

withAny25 lines

Counts with the any operator

{
  "countryList": [
    {
      "country": "russia",
      "operatorMap": {
        "any": {
          "vk": 10,
          "ok": 25,
          "wa": 52
        }
      }
    },
    {
      "country": "ukraine",
      "operatorMap": {
        "any": {
          "vk": 10,
          "ok": 50,
          "wa": 132
        }
      }
    }
  ],
  "status": "SUCCESS"
}
perOperator25 lines

Counts per operator, without any

{
  "countryList": [
    {
      "country": "ukraine",
      "operatorMap": {
        "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...