gethttps://onlinesim.io/api/rent/getRentState.php

GET /api/rent/getRentState.php

Get information about the state of virtual phone number rent operation

This request returns a list of active rental numbers.

You can use it to quickly browse all your active rental numbers (or only specific one) and their received messages.

Security

OAuth2Scopes: rent-scope
rent-scope
grants access to renting phone numbers from Onlinesim

Parameters

query3
NameTypeDescription
tzidinteger

'Operation ID.

If not specified, request will return the entire list of active rental operations'

paginationboolean

Pagination mode for message browsing (disabled if false)

Default:falseExample:false
langstring

Response language: fr - French, de - German, ru - Russian, en - English, zh - Chinese. Please note that the translation applies only to string field values, such as service names or country names. Field names themselves, error messages, and standard values (for example, true/false for boolean fields) remain in English.

Enum:frderuenzhDefault:ruExample:en

Responses

200

'Successful response for getRentState request: the server returns information of specified active rental operation (or all of them) or throws an exception.'

Content-Typeapplication/json
Schema
Responseobject
responseoneOf

1, if the request has been completed successfully, or an error message

Example:1
One Of
[0]integer
[1]string
listobject[]

List of active rental operations

itemsobject
statusinteger

'Status code of rent, upon issuing always 0:

0 - awaiting operation confirmation (SMS has to be received in the first 20 minutes after the order, else the operation will be refunded)

1 - rent is active

2 - DEPRECATED number is disabled

3 - DEPRECATED rent error

4 - number has been frozen/put on hold (rent has been paused)'

Enum:01234Example:1
extensioninteger

'Extention availability for this number:

0 - extention is unavailable

1 - extention is available

2 - auto-renewal (the rental will be automatically extended for 30 days upon expiration, provided there are sufficient funds in the account)'

Enum:012Example:1
messagesobject[]
itemsobject
idinteger

Message ID

≥ 1
Example:1
servicestring

Phone number or a name of a sender

Example:Google
textstring

Context of the SMS

Example:Your verification code is 070051
codestring

Short code

Example:070051
created_atstring

Date and time when the message was received

Example:2022-07-17 21:46:58
sumstring

Total rental cost (initial period + extension periods)

Example:251.5
countryinteger

'International dialing code of the country (Е.164 standard, without "+" sign), see country list'

Example:46
checked_timestring

Date and time of number rental

Example:2022-07-17 21:41:20
numberstring

Issued virtual phone number (without country code)

Example:9915584307
rentinteger

'Status code of rent, upon issuing always 0:

0 - awaiting operation confirmation (SMS has to be received in the first 20 minutes after the order, else the operation will be refunded)

1 - rent is active

2 - DEPRECATED number is disabled

3 - DEPRECATED rent error

4 - number has been frozen/put on hold (rent has been paused)'

Enum:01234Example:4
tzidinteger

Operation ID

≥ 1
Example:10000
timeinteger

Remaining rent time, (in minutes)

≥ 1
Example:5750
daysinteger

Remaining rent time, (in days)

≥ 0
Example:3
hoursinteger

Remaining rent time, (in hours)

≥ 1
Example:95
extendobject

Extention price

#period_in_days#integer

Extention price for each available extention period

≥ 1
Example:36
checkedboolean

'Rent status confirmation: if false SMS has to be received in the first 20 minutes after the order (after that status is switched to true), else the operation will be refunded.'

reloadinteger

'Availabitiy of reloading the number function:

0 - reset unavailable

1 - reset available'

Example:1
day_extendinteger

Price of rental extention for 1 day

≥ 1
Example:36
m_extboolean

Analog algorythm for rental extention is enabled

freezeboolean

'Current "on hold" status: if true - the number was frozen/put on hold and it is required to unfreeze it before continue to use it again (to do so, go to the user dashboard)'

Examples

Successful response to get all active rental operations39 lines
{
  "response": 1,
  "list": [
    {
      "status": 1,
      "extension": 1,
      "messages": [
        {
          "id": 1,
          "service": "Google",
          "text": "G-249833 – Ваш проверочный код.",
          "code": "249833",
          "created_at": "2022-07-17 21:46:58"
        }
      ],
      "sum": "251.50",
      "country": 7,
      "checked_time": "2022-07-17 21:41:20",
      "number": "9915584307",
      "rent": 4,
      "tzid": 22867974,
      "time": 5728,
      "days": 3,
      "hours": 95,
      "extend": {
        "1": 36,
        "3": 108,
        "7": 252,
        "15": 540,
        "30": 1080
      },
      "checked": true,
      "reload": 0,
      "day_extend": 36,
      "m_ext": false,
      "freeze": false
    }
  ]
}

Code Samples

Generating examples...