Skip to content

GetRent

Pavel Kuzmin edited this page Feb 6, 2023 · 6 revisions

[<< go back]

Diagram

Diagram

from onlinesimru import UserService

client = UserService('YOUR_TOKEN')
rent = client.rent()

Example

from onlinesimru import UserService


def main():
    client = UserService('YOUR_TOKEN')
    rent = client.rent()

    tariffs = rent.get_tariffs()
    print(tariffs)

    get = rent_new_number()
    print(get)

    state = rent.get_numbers()
    print(state)
    # or 
    state = rent.get_number(tzid)
    print(state)
    ...
    close = rent.revoke_number(tzid)
    close(state)

main()

rent_new_number [docs ru] [docs en]

Get new rent number

Params Default Description
$country 7 country
$days 1 count rent days
$extension false. auto extension

get_numbers [[docs ru](https://onlinesim.ru/docs/api/ru/rent/getRentState] [docs en]

Get numbers list


get_number [docs ru] [docs en]

Get selected number

Params Default Description
$tzid no oreration tzid

extend_number_rental [docs ru] [docs en]

Extend user number

Params Default Description
$tzid no operation tzid
$days 1 days count

rent_new_number [docs ru] [docs en]

Rent tariffs


revoke_number [docs ru] [docs en]

Close selected number

Params Default Description
$tzid no operation tzid