v1 rent

Finish rent operation of a virtual phone number

POST{yourserver}/finishActivationRent

This request is sent by the OnlineSIM server to close the current rent operation with a status that depends on its result.

By default, this request is sent when the rent expires. It may also be sent earlier:

  1. when the client terminates the rent ahead of time;
  2. when no SMS was received during the waiting period after the operation was created (20 minutes by default, depends on the integration) - with status 4.

Request Body

Request payload from the OnlineSIM server

Content-Typeapplication/json
Schema
schemaobject
actionstringRequired
Method name, in this case FINISH_ACTIVATIONEnum:FINISH_ACTIVATIONExample:FINISH_ACTIVATION
activationIdintegerRequired
Operation ID (assigned by your server in GET_NUMBER)≥ 1Example:355
statusintegerRequired
Status code of the operation: 3 - the rent was used (an SMS was received) 4 - cancelled, no SMS was received 1 - sent instead of 4 by some integrations when the number has failed to receive an SMS several timesEnum:134Example:3
keystringRequired
API key of your OnlineSIM partner profileExample:apikey
sumnumber
Your income for the whole rent (initial period plus all extensions), in RUB; credited to your OnlineSIM account when the rent is closedExample:870

Examples

used

Closing a used rent operation

{
  "action": "FINISH_ACTIVATION",
  "activationId": 75491,
  "status": 3,
  "key": "apikey",
  "sum": 2408
}

Responses

200The answer of your server to FINISH_ACTIVATION (for rent). Only status: SUCCESS closes the operation; for statuses 3 and 4 the answer {"status": "ERROR", "error": "record not found"} is accepted as closed too.
Content-Typeapplication/json
Schema
schemaobject
statusstringRequired
SUCCESS - the rent is closed on your side; anything else - the request will be repeatedEnum:SUCCESSERRORExample:SUCCESS
errorstring
Error text. record not found (unknown activationId) is accepted as closed for statuses 3 and 4Example:record not found

Examples

success

The rent operation is closed on your server

{
  "status": "SUCCESS"
}

Code Samples

Generating examples...