rent

Get information on tariffs for rent numbers

GEThttps://onlinesim.io/api/rent/tariffsRent.php

Returns the rent tariffs of one country (or of all countries when country is not given): rent periods, prices in USD and free numbers.

Unlike regular SMS receiving, rental implies a longer period of use. Also, unlike regular receiving, you can receive any number of SMS messages during the entire rental period from various senders: from websites and applications to SMS sent from regular mobile numbers.

If you rent a number with the extension option (extension=1 in getRentNum), you can extend the rental before it expires, once the first SMS has arrived.

No key is needed. A key sent with the request is still checked: an invalid one gives HTTP 456, and an OAuth token must carry rent-scope. POST with the same parameters works too.

Parameters

query2
NameTypeDescription
countryinteger

Country code. The value must match a code exactly (07 matches nothing). An unknown code or a country without rent gives []; without the parameter (or with 0) all countries are returned

langstring

Language of the texts in the answer (country and service names, status texts): fr, de, ru, en or zh. Every method accepts it; methods without such texts answer the same in any language. Field names, error codes and other fixed values stay in English. Without the parameter: ru for getTariffs, getNumbersStats and getFreeList; otherwise the language of the profile for requests with a key, English for requests without one. An unsupported value falls back to the default language

Enum:frderuenzh

Responses

200Tariffs of all countries, of one country, [], or an error
Content-Typeapplication/json
Schema
schemaoneOf
One Of
[0]objectMap of countries. Keys are country codes as strings (e.g. "7", "46", "373"), values are rentCountryTariff objects
[1]object
[2]object[]Empty array: the country is unknown or has no rent, or the tariffs are not loaded yetmaxItems: 0Example:[]
[3]object

Examples

List of number rental tariffs for all countries48 lines

List of rental and renewal terms and tariffs for all countries

{
  "7": {
    "code": 7,
    "enabled": true,
    "name": "russia",
    "new": false,
    "position": 7,
    "count": {
      "1": 120,
      "3": 120,
      "7": 120,
      "15": 120,
      "30": 120
    },
    "days": {
      "1": 0.9,
      "3": 1.5,
      "7": 3,
      "15": 5.5,
      "30": 9
    },
    "extend": 120,
    "confirm": false,
    "ext_counts": {
      "1": 120,
      "3": 120,
      "7": 120,
      "15": 120,
      "30": 120
    }
  },
  "46": {
    "code": 46,
    "enabled": false,
    "name": "sweden",
    "new": false,
    "position": 46,
    "count": {
      "7": 0,
      "30": 0
    },
    "days": {
      "7": 4.5,
      "30": 9.5
    },
    "extend": 0
  }
}
List of number rental tariffs for one country30 lines

List of rental and renewal terms and tariffs for the specified country

{
  "code": 7,
  "enabled": true,
  "name": "russia",
  "new": false,
  "position": 7,
  "count": {
    "1": 120,
    "3": 120,
    "7": 120,
    "15": 120,
    "30": 120
  },
  "days": {
    "1": 0.9,
    "3": 1.5,
    "7": 3,
    "15": 5.5,
    "30": 9
  },
  "extend": 120,
  "confirm": false,
  "ext_counts": {
    "1": 120,
    "3": 120,
    "7": 120,
    "15": 120,
    "30": 120
  }
}
Unknown country

Unknown country or a country without rent

[]
429HTTP 429: more than 400 requests per minute from one profile (from one IP for requests without a key), or more than 200 requests per minute from one profile to getNum, getPrice, getState and setOperationOk together
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Rate limit

Request rate limit exceeded

{
  "response": "TRY_AGAIN_LATER"
}
456HTTP 456: the API key is invalid or the OAuth token has expired. Public methods answer the same way when an invalid key is sent
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Invalid key

Invalid API key or expired token

{
  "response": "ERROR_WRONG_KEY"
}

Code Samples

Generating examples...