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

GET /api/rent/extendRentState.php

Extend virtual phone number rent

Extends a rent for a specified period (in days).

This request is needed when your rental period is about to expire, but you plan to continue using it.

Security

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

Parameters

query3
NameTypeDescription
tzid*integer
≥ 1

Operation ID

Example:10000
days*integer
≥ 0

Extention period for rental number (in days). Can only accept values listed in extend section of getRentState response

Example:15
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 extendRentState request: extends the rent of a number with requested parameters 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
itemobject

List of active rental numbers of your profile

statusinteger
Example: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
current_pageinteger

'All messages are sorted in reverse chronological order and are grouped into pages, each containing 20 messages (first page contains the last 20 messages)'

Example:1
dataoneOf[]
itemsoneOf
One Of
[0]object
[1]object[]
frominteger

Number of the first message on this page

≥ 1
Example:1
last_pageinteger

Number of last page with received SMS messages

≥ 1
Example:12
per_pageinteger

Amount of messages displayed on a single page (20 by default)

Default:20Example:20
tointeger

Number of the last message on the current page

≥ 1
Example:12
totalinteger

Total amount of SMS received by this number

≥ 1
Example:234
sumnumber

Total rental cost (initial period + extension periods)

≥ 1
Example:251.5
countryinteger

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

Example:46
checked_timestring

Date and time when this number was ordered for rent

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

Issued virtual 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 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 rental extention response47 lines
{
  "response": 1,
  "item": {
    "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
  }
}

Code Samples

Generating examples...