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
application/jsonschemaobject
GET_NUMBEREnum:GET_NUMBERExample:GET_NUMBERapikeygermanyanyEnum:anyExample:anyrent - 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:rent320Examples
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)
application/jsonschemaobject
SUCCESS. Issued phone number in international format with the country code, digits only (a JSON number or a string of digits)Example:79088081050SUCCESS. Operation ID assigned by your server; OnlineSIM reads it as an integer and sends it back in FINISH_ACTIVATION≥ 1Example:355SUCCESS- the number is issued;NO_NUMBERS- no available numbers;- any other value (e.g.
ERROR) - an error.
SUCCESS OnlineSIM tries the next partner.Enum:SUCCESSNO_NUMBERSERRORExample:SUCCESSExamples
The number is issued for rent
{
"number": 79281234567,
"activationId": 355,
"status": "SUCCESS"
}No available numbers
{
"status": "NO_NUMBERS"
}Any other error
{
"status": "ERROR"
}