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:
- when the client terminates the rent ahead of time;
- 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-Type
application/jsonSchema
schemaobject
actionstringRequired
Method name, in this case FINISH_ACTIVATIONEnum:FINISH_ACTIVATIONExample:FINISH_ACTIVATIONactivationIdintegerRequired
Operation ID (assigned by your server in GET_NUMBER)≥ 1Example:355statusintegerRequired
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:3keystringRequired
API key of your OnlineSIM partner profileExample:apikeysumnumber
Your income for the whole rent (initial period plus all extensions), in RUB; credited to your OnlineSIM account when the rent is closedExample:870Examples
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-Type
application/jsonSchema
schemaobject
statusstringRequired
SUCCESS - the rent is closed on your side; anything else - the request will be repeatedEnum:SUCCESSERRORExample:SUCCESSerrorstring
Error text. record not found (unknown activationId) is accepted as closed for statuses 3 and 4Example:record not foundExamples
success
The rent operation is closed on your server
{
"status": "SUCCESS"
}Code Samples
Generating examples...