Order a virtual number for the specified service
POST{yourserver}/getNumber
Request for ordering a number for SMS receiving from a specified service.
This request is sent to your server to order a number with specific parameters to receive SMS from a single service for short period (default is 15 minutes).
The operation can be closed prematurely (check FINISH_ACTIVATION).
Parameters
header2
| Name | Type | Description |
|---|---|---|
Authorization* | string | see more here |
Content-Type* | string |
Enum: application/json; charset=utf-8 |
Request Body
Request payload from Onlinesim server
Content-Type
application/jsonSchema
schemaobject
actionstringRequired
Method name, in this case GET_NUMBEREnum:GET_NUMBERDefault:GET_NUMBERcountrystringRequired
'Country name, enum (country
list)'operatorstringRequired
'Operator name (for examples take a look at operator
list)'servicestringRequired
'Service name, enum (service
list)'sumnumberRequired
Service price, in RUB (this sum will be credited to your
Onlinesim account after successful operation)keystringRequired
API key of your Onlinesim partner's profileexceptionPhoneSetinteger[]List of exception prefixes that SHOULD NOT be issued when the number is requested. Format: country code + following digits of a number.
Examples
Example payload of Onlinesim server GET_NUMBER request
{
"action": "GET_NUMBER",
"country": "russia",
"operator": "any",
"service": "vk",
"sum": 40,
"key": "apikey"
}Responses
200The response of your server for GET_NUMBER request must be in following format:
Headers
| Name | Type | Description |
|---|---|---|
Content-Type | string |
|
Content-Type
application/jsonSchema
schemaobject
numberintegerRequired
Phone number in international format according to the
requested parametersactivationIdintegerRequired
Operation ID (assigned by your server)≥ 1statusstringRequired
Request status (SUCCESS - when number is successfully issued, NO_NUMBERS - when there are no available numbers, ERROR - for other errors)Enum:SUCCESSNO_NUMBERSERRORExamples
Successful response example from your server
{
"number": 79281234567,
"activationId": 355,
"status": "SUCCESS"
}No available numbers response example from your server
{
"number": null,
"activationId": null,
"status": "NO_NUMBERS"
}Response example from your server in case of other types of errors
{
"number": null,
"activationId": null,
"status": "ERROR"
}Code Samples
Generating examples...