POST /getNumberRent
Order rent of a virtual phone number
This request creates a new rent operation, which will allow to use a number to receive SMS from any service and other mobile numbers for a long period of time (from 1 day up to several months).
DANGER
DO NOT CLOSE an operation before FINISH_ACTIVATION request.
TIP
You can either create a new endpoint for rent orders only or use the same GET_NUMBER endpoint as for single-service activations (v1).
However in the latter case you need to modify it so your server could create the rental operation correctly.
WARNING
Your server must issue a number for rent with specified parameters within 10 seconds of the request. Otherwise current request will be cancelled.
If number won't receive SMS within 20 minutes after operation is created, the operation will be cancelled automatically, making it available for another operation. If number fails 3 consecutive operations to receive SMS within 20 minutes, it will be banned by our server. These bans are lifted automatically every 24 hours.
Rent can be prolonged by the client, but the income is CREDITED UPON OPERATION CLOSING (upon rent expiration or termination).
WARNING
We're blocking messages from banks, payment systems and credit institutions to prevent any legal consequences for our partners that might be caused by unscrupulous customers.
At the same time long term rental does not support any exceptions for services as we don't know beforehand which service may or may not be used by our clients.
Please keep in mind that ANY BLACKLISTED SERVICES YOU MAY ADD FOR SINGLE-SERVICE ACTIVATIONS WILL NOT BE APPLIED FOR RENT.
WARNING
You will have to implement a fucntionality for number's mask exception for rent (same as for regular SMS receiving): optional parameter exceptionPhoneSet might contain an array with exception set. When one does, your server should exclude numbers with matching patters from issuing them.
For example, if [46950] value is passed, your server should not issue numbers of Sweden for rent that start with +46950*
%20%5BGET_NUMBER%5D.png)
Parameters
| Name | Type | Description |
|---|---|---|
Authorization* | string | see more here Example: Bearer apikey |
Request Body
Request payload from Onlinesim server for rent operation
Content-Type:
application/jsonBodyobject
actionstringRequired
Method name, in this case GET_NUMBER
Enum:
GET_NUMBERDefault:
GET_NUMBERExample:
GET_NUMBERkeystringRequired
API key of your Onlinesim partner’s profile
servicestringRequired
Service name, enum. For long term rental value is always
rent
Enum:
rentExample:
rentsumnumberRequired
Price for initial rental period, in RUB (this amount will be
credited to your Onlinesim account when operation is closed
successfully)
Example:
320exceptionPhoneSetinteger[]
List of exception prefixes that SHOULD NOT BE ISSUED
when the number is requested.
Format: country code + following digits of a number.
I.e, when value 46950 is passed, numbers of Sweden starting
with +46950 shouldn’t be issued
Responses
200
The response of your server for GET_NUMBER request must be in
following format:
Code Samples
No code samples available