v1 rent

Order rent of a virtual phone number

POST{yourserver}/getNumberRent

This request creates a new rent operation, which allows the client 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).

By default, if the number does not receive an SMS within 20 minutes after the operation is created, the operation is closed automatically with status 4, making the number available for another operation (the waiting period depends on the integration).

Rent can be extended by the client. Extensions are not sent to you as separate requests: the income for the whole rent is CREDITED UPON OPERATION CLOSING (upon rent expiration or termination) and passed as sum in FINISH_ACTIVATION.

Request Body

Request payload from the OnlineSIM server for a rent operation

Content-Typeapplication/json
Schema
schemaobject
actionstringRequired
Method name, in this case GET_NUMBEREnum:GET_NUMBERExample:GET_NUMBER
keystringRequired
API key of your OnlineSIM partner profileExample:apikey
countrystringRequired
Country name from the country listExample:germany
operatorstringRequired
Operator name, for rent always anyEnum:anyExample:any
servicestringRequired
Rent type: rent - a rent that the client may extend, rent_noext - a rent without extension. Integrations that order rent per period get the period in days appended (rent7, rent_noext30); otherwise the period is not passedExample:rent
sumnumberRequired
Your income for the initial rent period, in RUBExample:320

Examples

request

GET_NUMBER request from the OnlineSIM server (for rent)

{
  "action": "GET_NUMBER",
  "key": "apikey",
  "country": "germany",
  "operator": "any",
  "service": "rent",
  "sum": 400
}

Responses

200The answer of your server to GET_NUMBER (for rent)
Content-Typeapplication/json
Schema
schemaobject
numberinteger | string
Required with SUCCESS. Issued phone number in international format with the country code, digits only (a JSON number or a string of digits)Example:79088081050
activationIdinteger
Required with SUCCESS. Operation ID assigned by your server; OnlineSIM reads it as an integer and sends it back in FINISH_ACTIVATION≥ 1Example:355
statusstringRequired
Request status:
  • SUCCESS - the number is issued;
  • NO_NUMBERS - no available numbers;
  • any other value (e.g. ERROR) - an error.
On anything but SUCCESS OnlineSIM tries the next partner.
Enum:SUCCESSNO_NUMBERSERRORExample:SUCCESS

Examples

success

The number is issued for rent

{
  "number": 79281234567,
  "activationId": 355,
  "status": "SUCCESS"
}
noNumbers

No available numbers

{
  "status": "NO_NUMBERS"
}
error

Any other error

{
  "status": "ERROR"
}

Code Samples

Generating examples...