post{yourserver}/finishActivationRent

POST /finishActivationRent

Finish rent operation of a virtual phone number

This request is sent by Onlinesim server to close current rent operation with a specific status (which depends on the result of operation).

By default, this request is sent when the operation time expires. The request may also be sent earlier in one of the following two cases:

  1. if an SMS from the requested service was successfully received and the client closes the rental operation ahead of time;
  2. if an SMS from the requested service was not received and the operation is closed after the protective interval expires (20 minutes from the moment the operation was created).

Receiving a request with status 1 is a signal that the number for some reason failed to receive an SMS from the requested service within three (or more) operations. You can use this status as an indicator for the need to check the number and exclude it from issuing in the future, or ignore it.

Parameters

header1
NameTypeDescription
Authorization*string

see more here

Request Body

Request payload from Onlinesim server

Content-Typeapplication/json
Schema
Bodyobject
actionstringRequired

Method name, in this case FINISH_ACTIVATION

Enum:FINISH_ACTIVATIONDefault:FINISH_ACTIVATION
activationIdintegerRequired

Operation ID (assigned by your server)

≥ 1
statusintegerRequired

Status code of the operation, enum:

1 - Number failed to receive SMS within three (or more) rent operations. Check if there are any problems with this number, maybe it should be excluded from issuing in the future

3 - Successfully sold

4 - Cancelled, message was not delivered

5 - Refunded, in case of errors and message problems

Enum:134
keystringRequired

API key of your Onlinesim partner's profile

servicestringRequired

Service name, in this case rent

Enum:rent
sumnumber

Total service price that includes all rental periods, in RUB (this sum will be credited to your Onlinesim account after successful rental operation)

Examples

Example payload of Onlinesim server FINISH_ACTIVATION request (for closing rent operation)
{
  "action": "FINISH_ACTIVATION",
  "activationId": 75491,
  "status": 3,
  "key": "apikey",
  "service": "rent",
  "sum": 2408
}

Responses

200

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

Content-Typeapplication/json
Schema
Responseobject
statusstring

Request status (SUCCESS or ERROR)

Enum:SUCCESSERROR

Examples

Response example from your server (when the rental operation was successfuly closed on your server)
{
  "status": "SUCCESS"
}

Code Samples

Generating examples...