Finish rent operation of a virtual phone number
POST{yourserver}/finishActivationRent
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:
- if an SMS from the requested service was successfully received and the client closes the rental operation ahead of time;
- 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
| Name | Type | Description |
|---|---|---|
Authorization* | string | see more here |
Request Body
Request payload from Onlinesim server
Content-Type
application/jsonSchema
schemaobject
actionstringRequired
Method name, in this case FINISH_ACTIVATIONEnum:FINISH_ACTIVATIONDefault:FINISH_ACTIVATIONactivationIdintegerRequired
Operation ID (assigned by your server)≥ 1statusintegerRequired
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 problemsEnum:134keystringRequired
API key of your Onlinesim partner's profileservicestringRequired
Service name, in this case rentEnum:rentsumnumber
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
200The response of your server for FINISH_ACTIVATION request must be
in following format:
Content-Type
application/jsonSchema
schemaobject
statusstring
Request status (SUCCESS or ERROR)Enum:SUCCESSERRORExamples
Response example from your server (when the rental operation was successfuly closed on your server)
{
"status": "SUCCESS"
}Code Samples
Generating examples...