GEThttps://onlinesim.io/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

OAuth2
rent-scope
grants access to renting phone numbers from Onlinesim

Parameters

query6
NameTypeDescription
tzidstring

Operation ID, returned by the server when a number is issued (in response to a getNum or getRentNum request). The list of active operations of the profile with their IDs can also be obtained via getState - for receiving operations, and via getRentState - for rental operations. If the operation ID is not passed, the response will contain data on all operations

paginationboolean

Pagination mode for message browsing (disabled if false)

Default:false
pageinteger
≥ 1

Page of messages (only relevant when pagination is enabled)

per_pageinteger
≥ 1

Number of messages per page, default is 20 (only relevant when pagination is enabled)

Default:20
orderbystring

Sort order of SMS messages by their time of receipt:

asc - sorting from oldest to newest;

desc - sorting from newest to oldest

Enum:ascdescDefault:desc
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:ru

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
schemaoneOf

Successful response or a common error. An OAuth token without rent-scope returns a scope error — see tariffsRentOAuthScopeError component

One Of
[0]object
[1]object

Examples

Operation list with paginationexample_lines

Paginated list of SMS

{
  "response": 1,
  "list": [
    {
      "status": 1,
      "extension": 1,
      "messages": {
        "current_page": 1,
        "data": [
          {
            "id": 1,
            "service": "Google",
            "text": "G-249833 – Ваш проверочный код.",
            "code": "249833",
            "created_at": "2022-07-17 21:46:58"
          }
        ],
        "from": 1,
        "last_page": 1,
        "per_page": 20,
        "to": 1,
        "total": 1
      },
      "sum": 251.5,
      "country": 7,
      "checked_time": "2022-07-17 21:41:20",
      "number": "9915584307",
      "rent": 4,
      "tzid": 22867974,
      "time": 5750,
      "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
    }
  ]
}
Operation list with flat SMS arrayexample_lines

Flat SMS array (pagination=false)

{
  "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.5,
      "country": 7,
      "checked_time": "2022-07-17 21:41:20",
      "number": "9915584307",
      "rent": 4,
      "tzid": 22867974,
      "time": 5750,
      "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
    }
  ]
}
Empty list

No active rentals operations

{
  "response": 1,
  "list": []
}

Code Samples

Generating examples...