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

GET /api/rent/getRentNum.php

Buy virtual phone number for rent

This request allows you to rent a number of a specific country for SMS receiving.

You can use this request when you need to receive messages from multiple different services or from a single one, but over a long time period.

Security

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

Parameters

query5
NameTypeDescription
countryinteger
≥ 1

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

Default:7Example:46
days*integer
≥ 1

'Initial rental period (in days), see available values in tariffsRent response'

Example:1
extensionboolean

'Auto-renewal (when enabled, automatically extends the rental for 30 days upon expiration)'

Default:true
paginationboolean

Message pagination

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 getRentNum request: the server issues a number with requested parameters for rent 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
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)'

Example:0
messagesobject
current_pageinteger

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

≥ 1
Example:1
dataobject[]
itemsobject
frominteger

Number of the first message on this page

≥ 1
Example:1
last_pageinteger

Number of last page with received SMS messages

≥ 0
Example:12
per_pageinteger

Amount of messages displayed on a single page

Default:20Example:20
tointeger

Number of the last message on this page

≥ 0
Example:2
totalinteger

Total amount of SMS received by this number

≥ 0
Example:4
countryinteger

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

≥ 1
Default:7Example:46
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:01234
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
checked_timestring

Date and time when this number was issued for rent operation

Format:date-timeExample:2022-07-17 11:55:13
sumnumber

Price of rent

≥ 0
Example:215.5
numberstring

Phone number, without a country code

Example:9108501010
tzidinteger

Operation ID

≥ 1
Example:10000
timeinteger

Remaining rent time, (in minutes)

≥ 0
Example:19
daysinteger

Remaining rent time, (in days)

≥ 0
Example:0
hoursinteger

Remaining rent time, (in hours)

≥ 0
Example:14
extendobject

Extension prices

"extension_period_in days"integer

Extension price for X days

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 extension 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

Successfully issued rental number37 lines
{
  "response": 1,
  "item": {
    "status": 0,
    "messages": {
      "current_page": 1,
      "data": [],
      "from": 1,
      "last_page": 0,
      "per_page": 20,
      "to": 0,
      "total": 0
    },
    "country": 7,
    "rent": 3,
    "extension": 1,
    "checked_time": "2022-07-17 21:41:20",
    "sum": 215.5,
    "number": "9915584307",
    "tzid": 22867974,
    "time": 19,
    "days": 0,
    "hours": 0,
    "extend": {
      "1": 36,
      "3": 108,
      "7": 252,
      "15": 540,
      "30": 1080
    },
    "checked": false,
    "reload": 0,
    "day_extend": 36,
    "m_ext": false,
    "freeze": false
  }
}

Code Samples

Generating examples...