v1 rent

Order rent of a virtual phone number

POST{yourserver}/getNumberRent

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).

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).

Parameters

header1
NameTypeDescription
Authorization*string

see more here

Request Body

Request payload from Onlinesim server for rent operation

Content-Typeapplication/json
Schema
schemaobject
actionstringRequired
Method name, in this case GET_NUMBEREnum:GET_NUMBERDefault:GET_NUMBER
keystringRequired
API key of your Onlinesim partner's profile
countrystringRequired
Country name, enum (country list)'
operatorstringRequired
'Operator name (for examples take a look at operator list)'
servicestringRequired
Service name, enum. For long term rental value is always rentEnum:rent
sumnumberRequired
Price for initial rental period, in RUB (this amount will be credited to your Onlinesim account when operation is closed successfully)
exceptionPhoneSetinteger[]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

Examples

Example payload of Onlinesim server GET_NUMBER request (for rent)
{
  "action": "GET_NUMBER",
  "key": "apikey",
  "country": "germany",
  "operator": "any",
  "service": "rent",
  "sum": 400
}

Responses

200The response of your server for GET_NUMBER request must be in following format:

Headers

NameTypeDescription
Content-Typestring

Content type header and encoding scheme

Content-Typeapplication/json
Schema
schemaobject
numberintegerRequired
Phone number in international format according to the requested parameters
activationIdintegerRequired
Operation ID (assigned by your server)≥ 1
statusstringRequired
Request status (SUCCESS - when number is successfully issued, NO_NUMBERS - when there are no available numbers, ERROR - for other errors)Enum:SUCCESSNO_NUMBERSERROR

Examples

Successful response example from your server
{
  "number": 79281234567,
  "activationId": 355,
  "status": "SUCCESS"
}
No available numbers response example from your server
{
  "number": null,
  "activationId": null,
  "status": "NO_NUMBERS"
}
Response example from your server in case of other types of errors
{
  "number": null,
  "activationId": null,
  "status": "ERROR"
}

Code Samples

Generating examples...