rent

Close the rent

GEThttps://onlinesim.io/stubs/handler_api.php?action=setRentStatus

Closes the rent (status=2, the only supported value). A rent without SMS can be closed 120 seconds after the start, its reservation is released; a confirmed rent is closed without a refund. US numbers cannot be closed early.

Errors as JSON:

  • NO_ID_RENT — id is missing, or no active rent with this id
  • INCORECT_STATUS — status is not 2

Errors as text: EARLY_CANCEL_DENIED (less than 120 seconds since the start of a rent without SMS), BAD_ACTION (a US number, or the number could not be closed now: repeat later) and the common errors.

Security

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

Parameters

query3
NameTypeDescription
action*string

Method name: setRentStatus

Enum:setRentStatus
id*integer
≥ 1

Operation ID from getRentNumber or getRentList

Example:22867858
status*integer

2 — close

Enum:2Example:2

Responses

200Rent closed, or an error
text/plain
Schema
schemaoneOf
One Of
[0]string
Enum:EARLY_CANCEL_DENIED
[1]string
Error answered as text by every action (also by the JSON ones):
  • BAD_KEY — the API key is wrong or missing
  • BANNED — the account is blocked
  • BAD_ACTION — unknown action or an error without its own code (for example a temporary error or too many concurrent requests); check the request and repeat it later
  • Too many requests. Please wait a moment before trying again. — the converter's limit of getNumber, getRentNumber, setStatus and setRentStatus (3 requests per second, 150 per 30 seconds)
Enum:BAD_KEYBANNEDBAD_ACTIONToo many requests. Please wait a moment before trying again.
application/json
Schema
schemaoneOf
One Of
[0]object
[1]objectError of a JSON action. The codes are listed at each action

Examples

closed

Rent closed

{
  "status": "success"
}
noRent

No such rent

{
  "status": "error",
  "message": "NO_ID_RENT"
}

Code Samples

Generating examples...