NAV undefined

OnlineSIM API

General

Example of requests

Specially for you, we have prepared several examples for postman

Run in Postman

docs in postmen

We also prepared packages for working with our api

PHP | JS | Python | Ruby | GO

General description

https://onlinesim.ru API provides you with the possibility to use our service in the automatic mode. For that purpose, you have to get an API key in the User Profile tab and to implement approximately the following operating procedure in the software:

  1. Request a virtual number, get the TZID (unique number of registered operation) - the getNum method;
  2. Get a mobile number by the TZID, enter the number into the confirmation form on the required website (service) – the getState method;
  3. Run the cycle that will check for receipt of a response - the getState method;
  4. If the response is correct — complete the operation – the setOperationOk method;
  5. If the response does not match — request elaboration – the setOperationRevise method;
  6. Complete the operation – the setOperationOk method;

In order to use the API, you have to perform a POST or GET request via the HTTP protocol to the specified URL: https://onlinesim.ru/api/{METHOD_NAME}.php?PARAMETERS&apikey=YOUR_APIKEY&lang=LANGUAGE

Method Description
METHOD_NAME name of the method from the list of API functions
PARAMETERS parameters of the relevant API method
YOUR_APIKEY access key set up in the User Profile tab.
LANGUAGE language, not required parameter. "de" - German; "en" - English; "ru" - Russian; "zh" - Chinese (Simplified);

Common returned responses

The RESPONSE parameter values are common for all methods.

json {response: RESPONSE, …, … }

Result Description
ACCOUNT_BLOCKED account blocked
ERROR_WRONG_KEY wrong apikey
ERROR_NO_KEY no apikey
ERROR_NO_SERVICE service not specified
REQUEST_NOT_FOUND API method not specified
API_ACCESS_DISABLED api disabled
API_ACCESS_IP access from this ip is disabled in the profile

getBalance

URL

https://onlinesim.ru/api/getBalance.php?apikey=api_key

It returns information on the balance.

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getBalance.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getBalance.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Название параметра Параметр Тип данных Описание
income non-required BOOLEAN if income = 1, returns additional information about earnings

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, "balance":BALANCE, "zbalance":ZBALANCE}

Result Description
response 1, if the request has been completed successfully, or an error message
balance active cash amount.
zbalance frozen cash amount.

SMS Reception

General description

Api for ordering numbers for receiving SMS from the service

In order to use the API, you need to make a POST or GET request via HTTP to the specified URL: https://onlinesim.ru/api/{METHOD_NAME}.php

Diagram

Workflow Diagram

getNumbersStats

URL

https://onlinesim.ru/api/getNumbersStats.php?apikey=api_key

To obtain the relevant statistics by country and number

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getNumbersStats.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getNumbersStats.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

statistics on numbers

Parameters

Name of parameter Parameter Type of data Description
country non-required INT Without parameter - 7

All countries - all7 - 俄罗斯
380 - 乌克兰
49 - 德国
357 - 塞浦路斯
44 - 英国
33 - 法国
1 - 美国
1000 - 加拿大
55 - 巴西
63 - 菲利宾
86 - 中国
77 - 哈萨克斯坦
996 - 吉尔吉斯斯坦
40 - 罗马尼亚语
48 - 波兰
420 - 捷克共和国
43 - 奥地利
371 - 拉脱维亚
373 - 摩尔多瓦
998 - 乌兹别克斯坦
967 - 也门
234 - 尼日利亚
225 - 科特迪瓦
233 - 加纳
232 - 谢尔·里昂

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {"7":{"name":"russia","services":{"0":{"count":null,"popular":true,"price":23,"id":0,"service":"Вконтакте","slug":"VKcom"},"1":{"count":22,"popular":true,"price":2,"id":1,"service":"Facebook","slug":"3223"}

Result Description
[code: name, ..., services: [code: {count, popular, price, id, service, slug}]] The array of available services and countries, in format: code: {Name of the country, services: {order number: { count(null - no data), popular or not, price, service id, service name, service code for getNum}...

Description

Parameter Description
name country name
position Position in the list on the website
code country code, need to order via getNum
new if true, the country was recently added
enabled Enabled country
services Array with the list of available Services
Parameter Description
count Number of available rooms is updated once per minute
popular a popular service or not
price purchase Price
id ID to generate a list
service service name
slug slug for the order via getNum
image: the path to the picture

getNum

URL

https://onlinesim.ru/api/getNum.php?apikey=api_key&service=VKcom

It makes a request for a virtual number, creates an operation (saves the list of request parameters).

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getNum.php?apikey=api_key&service=VKcom",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getNum.php?apikey=api_key&service=VKcom",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
service required TEXT defines the website (service), which the SMS will be expected and displayed from. see services
simoperator non-required INT Without parameter - any simoperator
25001 - MTS
25002 - MegaFon
25099 - Beeline
25020 - Tele2
region non-required INT Without parameter - any region
78 - St. Petersburg
77 - Moscow
country non-required INT Without parameter - 7
see countries
reject non-required ARRAY Array mask reject, Example: [911,912123] reject all numbers, start at 911* and 912123*.
extension non-required INT Without parameter - 7
Extension of the number.
3 or 0 - without Extension.
2 - extension for a month
dev_id non-required INT account id for software developers.
number non-required BOOL If you pass this parameter, the query will return the number.

Services

You can find out the list of countries and services through the request see countries and services

** If Other is selected, the incoming SMSs will not be filtered, therefore if the required service is absent in the list, the sender's name has to be transmitted, for example if the SMS is received from Gett, service=Gett. You can see the list of popular senders in your account, in the All Services block, the drop-down list next to the Add button. **

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, tzid:TZID}

Result Description
response 1, if the request has been completed successfully, or an error message
tzid Operation ID

RESPONSE

Result Description
EXCEEDED_CONCURRENT_OPERATIONS maximum quantity of numbers booked concurrently is exceeded for your account
NO_NUMBER temporarily no numbers available for the selected service
TIME_INTERVAL_ERROR delayed SMS reception is not possible at this interval of time
INTERVAL_CONCURRENT_REQUESTS_ERROR maximum quantity of concurrent requests for number issue is exceeded, try again later
ERROR_NO_SERVICE service is not specified
TRY_AGAIN_LATER temporarily unable to perform the request
NO_FORWARD_FOR_DEFFER forwarding can be activated only for online reception
NO_NUMBER_FOR_FORWARD there are no numbers for forwarding
ERROR_LENGTH_NUMBER_FOR_FORWARD wrong length of the number for forwarding
DUPLICATE_OPERATION adding operations with identical parameters

Testing

/demo/api/getNum.php?apikey=api_key&service=VKcom

The method will return generated test data. To test errors, forward the required error as the err parameter. For example, err=EXCEEDED_CONCURRENT_OPERATIONS

getState

URL

https://onlinesim.ru/api/getState.php?apikey=api_key

It returns the state for the selected operation or all operation

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getState.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getState.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
tzid non-required INT operation identifier, if need
message_to_code non-required INT 1 - display only the code from the SMS, 0 - show the entire SMS
form non-required INT type of reception, 1 - online reception, 2 - repeated reception, 3 - delayed reception. Default value - 1,3
orderby non-required TEXT ascending/descending sorting asc/desc. Default value - asc
msg_list non-required INT Type of message list, 1 - the list, 0 - the active message
clean non-required INT 1 - do not show messages on a circle

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json [{tzid:TZID, response:RESPONSE, service:SERVICE, number:NUMBER, msg:MSG, time:TIME, form:FORM, forward_status:FORWARD_STATUS, forward_number:FORWARD_NUMBER}]

Result Description
response 1, if the request has been completed successfully, or an error message
tzid operation ID
service service, with the same values as in the getNum method
number dedicated virtual number, in the international format
msg code from the SMS
time time to operation completion;
form type of reception (online reception — index)
forward_status forwarding activation status (from 0 to 9 cm. Help – Forwarding Statuses)
forward_number number for forwarding
country Country of the number (7 - Russia, 86 - China)

RESPONSE

Result Description
WARNING_NO_NUMS no matching numbers
TZ_INPOOL waiting for a number to be dedicated to the operation
TZ_NUM_WAIT waiting for response
TZ_NUM_ANSWER response has arrived
TZ_OVER_EMPTY response did not arrive within the specified time
TZ_OVER_OK operation has been completed
ERROR_NO_TZID tzid is not specified
ERROR_NO_OPERATIONS no operations
ACCOUNT_IDENTIFICATION_REQUIRED You have to go through an identification process: to order a messenger - in any way, for forward - on the passport.
.

Testing

/demo/api/getState.php?apikey=api_key

The method will return generated test data.

setOperationRevise

URL

https://onlinesim.ru/api/setOperationRevise.php?apikey=api_key&tzid=1234

It creates a request for elaboration of response on the operation.

It should be used if a wrong code has been received. This method sends a request to a different code in case if multiple SMSs have been received at the same number with different codes.

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/setOperationRevise.php?apikey=api_key&tzid=1234",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/setOperationRevise.php?apikey=api_key&tzid=1234",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
tzid required INT operation identifier

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, tzid:TZID}

Result Description
tzid operation ID
response 1, if the request has been completed successfully, or an error message;

setOperationOk

URL

https://onlinesim.ru/api/setOperationOk.php?apikey=api_key&tzid=1234

It sends the notification of successful reception of the code and completes the operation

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/setOperationOk.php?apikey=api_key&tzid=1234",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/setOperationOk.php?apikey=api_key&tzid=1234",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
tzid required INT operation identifier
ban non-required INT Only for Chinese numbers, It can be used in case if you were not issued a number or did not receive the SMS within 5 minutes. Send 1 to block the number

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, tzid:TZID}

Result Description
response 1, if the request has been completed successfully, or an error message;
tzid operation ID

RESPONSE

Result Description
ERROR_WRONG_TZID wrong operation number.
NO_COMPLETE_TZID unable to complete the operation.

Testing

/demo/api/setOperationOk.php?apikey=api_key&tzid=1234

The method will return generated test data. To test errors, forward the required error as the err parameter. For example, err=ERROR_WRONG_TZID

getService

URL

https://onlinesim.ru/api/getService.php?apikey=api_key

Getting the list of services for a repeat order of SMS

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getService.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getService.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

It does not require additional parameters

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, service: ["service","...","..."]}

Result Description
response 1, if the request has been completed successfully, or an error message;
["service","...","..."] Array of services available for a repeated SMS. Possible options:
service Website (service) name
vkcom Вконтакте
3223 Facebook
mailru MailRu
odklru Одноклассники
google Google
yandex Yandex
avito Avito
youla Youla
viber Viber
whatsapp WhatsApp
telegram Telegram
fastfriend ДругВокруг
icq ICQ
instagram Instagram
wechat WeChat
steam Steam
uber Uber
microsoft Microsoft
7 Другие сайты

Testing

/demo/api/getService.php?apikey=api_key

The method will return generated test data.

getNumRepeat

URL

https://onlinesim.ru/api/getNumRepeat.php?apikey=api_key&service=1234&number=1234

It creates a request for repeated use of the virtual number

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getNumRepeat.php?apikey=api_key&service=1234&number=1234",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getNumRepeat.php?apikey=api_key&service=1234&number=1234",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
service required TEXT takes on one of the values obtained using the getService method
number required INT takes on one of the values obtained using the getServiceNumber method

RESPONSE

Result Description
EXCEEDED_CONCURRENT_OPERATIONS maximum quantity of concurrent operations has been exceeded
NO_NUMBER temporarily no numbers available for the selected service
TIME_INTERVAL_ERROR delayed SMS reception is not possible at this interval of time
INTERVAL_CONCURRENT_REQUESTS_ERROR maximum quantity of concurrent requests for number issue is exceeded, try again later
ERROR_NO_SERVICE service is not specified
ERROR_NO_NUMBER number is not specified
TRY_AGAIN_LATER temporarily unable to perform the request
ERROR_PARAMS one or both parameters are wrong
LIFICYCLE_NUM_EXPIRED the number has expired
NEED_EXTENSION_NUMBER you have to extend the number, see the Extension tab

Testing

/demo/api/getNumRepeat.php?apikey=api_key&service=1234&number=1234

The method will return generated test data. To test errors, forward the required error as the err parameter. For example, err=TRY_AGAIN_LATER

getServiceNumber

URL

https://onlinesim.ru/api/getServiceNumber.php?apikey=api_key&service=VKcom

It gets the list of numbers for the specified service.

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getServiceNumber.php?apikey=api_key&service=VKcom",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getServiceNumber.php?apikey=api_key&service=VKcom",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
service required TEXT takes on one of the values obtained using the getService method

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, number:["number","...","..."]}

Result Description
response 1, if the request has been completed successfully, or an error message;
["number","...","..."] array of services available for a repeated SMS.

RESPONSE

Result Description
ERROR_NO_SERVICE_REPEAT no services for repeated reception
SERVICE_TO_NUMBER_EMPTY no numbers for repeated reception for this service

Testing

/demo/api/getServiceNumber.php?apikey=api_key&service=VKcom

The method will return generated test data. To test errors, forward the required error as the err parameter. For example, err=SERVICE_TO_NUMBER_EMPTY

Forwarding

General description

Api for rent forward a number

In order to use the API, you need to make a POST or GET request via HTTP to the specified URL: https://onlinesim.ru/api/{METHOD_NAME}.php

Diagram

Workflow Diagram

getForward

URL

https://onlinesim.ru/api/getForward.php?apikey=api_key&forward_numbers[]=9371001010&service=unlimited_sms

It makes a request for a virtual number for forwarding, creates an operation (saves the list of request parameters).

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getForward.php?apikey=api_key&forward_numbers[]=9371001010&service=unlimited_sms",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getForward.php?apikey=api_key&forward_numbers[]=9371001010&service=unlimited_sms",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));
Name of parameter Parameter Type of data Description
forward_numbers required ARRAY List of numbers for forwarding. Setting the priorities depending on the position in the array (number in the 9XXXXXXXXX format)
service non-required STRING unlimited_sms - unlimited messages + forwarding.
forward_without_sms - forwarding without SMS
region non-required INT Without parameter - any region
78 - St. Petersburg
77 - Moscow
reject non-required ARRAY Array mask reject, Example: [911,912123] reject all numbers, start at 911* and 912123*.

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, tzid:TZID}

Result Description
response 1, if the request has been completed successfully, or an error message
tzid operation ID

RESPONSE

Result Description
ERROR_NUMBERS_PARAMS error in the number format
EXCEEDED_CONCURRENT_OPERATIONS maximum quantity of numbers booked simultaneously is exceeded for your account
NO_NUMBER temporarily no numbers available for the selected service
TIME_INTERVAL_ERROR delayed SMS reception is not possible at this interval of time
INTERVAL_CONCURRENT_REQUESTS_ERROR maximum quantity of concurrent requests for number issue is exceeded, try again later
TRY_AGAIN_LATER temporarily unable to perform the request
NO_FORWARD_FOR_DEFFER forwarding can be activated only for online reception
NO_NUMBER_FOR_FORWARD there are no numbers for forwarding
DUPLICATE_OPERATION adding operations with identical parameters

Testing

/demo/api/getForward.php?apikey=api_key&forward_number[]=9371001010&service=unlimited_sms

The method will return generated test data. To test errors, forward the required error as the err parameter. For example, err=EXCEEDED_CONCURRENT_OPERATIONS

getState

URL

https://onlinesim.ru/api/getState.php?apikey=api_key

It returns the state for the selected operation or all operation

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getState.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getState.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
tzid non-required INT operation identifier, if need
message_to_code non-required INT 1 - display only the code from the SMS, 0 - show the entire SMS
form non-required INT type of reception, 1 - online reception, 2 - repeated reception, 3 - delayed reception. Default value - 1,3
orderby non-required TEXT ascending/descending sorting asc/desc. Default value - asc
msg_list non-required INT Type of message list, 1 - the list, 0 - the active message
clean non-required INT 1 - do not show messages on a circle

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json [{tzid:TZID, response:RESPONSE, service:SERVICE, number:NUMBER, msg:MSG, time:TIME, form:FORM, forward_status:FORWARD_STATUS, forward_number:FORWARD_NUMBER}]

Result Description
response 1, if the request has been completed successfully, or an error message
tzid operation ID
service service, with the same values as in the getNum method
number dedicated virtual number, in the international format
msg code from the SMS
time time to operation completion;
form type of reception (online reception — index)
forward_status forwarding activation status (from 0 to 9 cm. Help – Forwarding Statuses)
forward_number number for forwarding
country Country of the number (7 - Russia, 86 - China)

RESPONSE

Result Description
WARNING_NO_NUMS no matching numbers
TZ_INPOOL waiting for a number to be dedicated to the operation
TZ_NUM_WAIT waiting for response
TZ_NUM_ANSWER response has arrived
TZ_OVER_EMPTY response did not arrive within the specified time
TZ_OVER_OK operation has been completed
ERROR_NO_TZID tzid is not specified
ERROR_NO_OPERATIONS no operations
ACCOUNT_IDENTIFICATION_REQUIRED You have to go through an identification process: to order a messenger - in any way, for forward - on the passport.
.

Testing

/demo/api/getState.php?apikey=api_key

The method will return generated test data.

setOperationRevise

URL

https://onlinesim.ru/api/setOperationRevise.php?apikey=api_key&tzid=1234

It creates a request for elaboration of response on the operation.

It should be used if a wrong code has been received. This method sends a request to a different code in case if multiple SMSs have been received at the same number with different codes.

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/setOperationRevise.php?apikey=api_key&tzid=1234",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/setOperationRevise.php?apikey=api_key&tzid=1234",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
tzid required INT operation identifier

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, tzid:TZID}

Result Description
tzid operation ID
response 1, if the request has been completed successfully, or an error message;

setOperationOk

URL

https://onlinesim.ru/api/setOperationOk.php?apikey=api_key&tzid=1234

It sends the notification of successful reception of the code and completes the operation

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/setOperationOk.php?apikey=api_key&tzid=1234",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/setOperationOk.php?apikey=api_key&tzid=1234",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
tzid required INT operation identifier
ban non-required INT Only for Chinese numbers, It can be used in case if you were not issued a number or did not receive the SMS within 5 minutes. Send 1 to block the number

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, tzid:TZID}

Result Description
response 1, if the request has been completed successfully, or an error message;
tzid operation ID

RESPONSE

Result Description
ERROR_WRONG_TZID wrong operation number.
NO_COMPLETE_TZID unable to complete the operation.

Testing

/demo/api/setOperationOk.php?apikey=api_key&tzid=1234

The method will return generated test data. To test errors, forward the required error as the err parameter. For example, err=ERROR_WRONG_TZID

forwardingList

URL

https://onlinesim.ru/api/forwardingList.php?apikey=api_key

It displays the list of all forwardings

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/forwardingList.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/forwardingList.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
id non-required INT unique number of the forwarding, to display the particular forwarding
page non-required INT sequential page number, 10 pcs. per page
sort non-required TEXT sorting, for example: {"number":"DESC","forward_number":"ASC"} 1 - field name for sorting, 2 - type of sorting (ASC,DESC)

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {"response": RESPONSE,"forwardingList": {"total": 17,"per_page": 10,"current_page": 1,"last_page": 2, "next_page_url": "https://onlinesim.ru/api/forwardingList.php?page=2","prev_page_url": null,"from": 1,"to": 10,"data": [......]}}

Name of parameter Description
total the total quantity
current_page the current page
last_page total pages
data array of the list of forwardings, and data on each forwarding

json {response:RESPONSE, forwarding": {"id": id,"id_user": id_user,"minutes": minutes,"status": status,"id_number": id_number, "number": number,"forward_number": forward_number,"created_at": created_at,"updated_at": updated_at,"extension": extension,"data": { "balance": data,"time_update_balance": time_update_balance,"region": region}}

Name of parameter Description
id unique number of forwarding
id_user user ID
minutes balance of minutes
status current status of the forwarding:
1 - Active
2 - Blocked
3 - Completed
4 - Replacement of the number
5 - Sent for blocking
6 - Waiting for completion
number the virtual number, which the forwarding has been set up from
forward_number the telephone number, which the forwarding has been set up to
extension automated extension (true - enabled, false - disabled)
balance current balance for the virtual number
time_update_balance date and time of the last balance update
region region of the virtual number

forwardingSave

URL

https://onlinesim.ru/api/forwardingSave.php?apikey=api_key&id=1

It changes the forwarding parameters

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/forwardingSave.php?apikey=api_key&id=1",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/forwardingSave.php?apikey=api_key&id=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
id required INT unique number of the forwarding obtained using the forwardingList method
forward_number non-required ARRAY the telephone numbers, which the forwarding has been set up to

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {"response": RESPONSE}

forwardingRemove

URL

https://onlinesim.ru/api/forwardingRemove.php?apikey=api_key&id=1

It deletes (disables) the forwarding

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/forwardingRemove.php?apikey=api_key&id=1",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/forwardingRemove.php?apikey=api_key&id=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
id required INT unique number of the forwarding obtained using the forwardingList method

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {"response": RESPONSE}

getCallNumberList

URL

https://onlinesim.ru/api/getCallNumberList.php?apikey=api_key&number=1234

It displays the list of all forwardings calls

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getCallNumberList.php?apikey=api_key&number=1234",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getCallNumberList.php?apikey=api_key&number=1234",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
number required INT unique number of the forwarding
count non-required INT count foreard(Default: 50)
page non-required INT sequential page number, 50 pcs. per page
order_by non-required string sorting(asc,desc)

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {"response": RESPONSE,"list": {"total": 17,"per_page": 10,"current_page": 1,"last_page": 2, "next_page_url": "https://onlinesim.ru/api/forwardingList.php?page=2","prev_page_url": null,"from": 1,"to": 10,"data": [......]}}

Name of parameter Description
total the total quantity
current_page the current page
last_page total pages
list array of the list of forwardings, and data on each forwarding

json {"id":1,"number":123,"number_forward_client":456,"number_forward":789,"payment_minutes":0,"start_at":null,"stop_at":"2017-10-25 14:11:57"}

Name of parameter Description
id unique ID of call
number_forward_client The number from which a call
number_forward The number to which forwarding is done
payment_minutes The count of paid minutes
created_at Start call
start_at Start conversation
stop_at End conversation

setForwardStatusEnable

URL

https://onlinesim.ru/api/setForwardStatusEnable.php?apikey=api_key&tzid=1

It confirms forwarding

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/setForwardStatusEnable.php?apikey=api_key&tzid=1",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/setForwardStatusEnable.php?apikey=api_key&tzid=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
tzid required INT operation identifier

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, TZID:tzid}

Parameter Description
response 1, if the request has been completed successfully, or an error message
tzid operation ID

RESPONSE

Result Description
NO_CONFIRM_FORWARD unable to confirm forwarding

Number rent

General description

Api for rent a number

In order to use the API, you need to make a POST or GET request via HTTP to the specified URL: https://onlinesim.ru/api/rent/{METHOD_NAME}.php

Diagram

Workflow Diagram

tariffsRent

URL

https://onlinesim.ru/api/rent/tariffsRent.php?apikey=api_key

Tariffs and other parameters.

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/rent/tariffsRent.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/rent/tariffsRent.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
country non-required INT Country, if you pass the parameter, it will return only the desired country.

Result

After successful execution, a response will be received in JSON format, as follows:

json [7: {code: 7,enabled: true,name: "russia",new: true, days: {1: 100,7: 350,15: 600,30: 900,},position: 7,count: "1",}, ...]

Result Description
code Country code
enabled true - the country is available for order
name Country name
new true - country added recently
days Room rental price: {number of days: price, ...}
position parameter for sorting in the interface
count Number of rooms available {number of days: count, ...}

getRentNum

URL

https://onlinesim.ru/api/rent/getRentNum.php?apikey=api_key&country=7&days=30

Getting a number

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/rent/getRentNum.php?apikey=api_key&country=7&days=30",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/rent/getRentNum.php?apikey=api_key&country=7&days=30",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
country required INT a country. 7 - Russia, 77 - Kazakhstan, 380 - Ukraine
days required INT Number of rental days. see tariffsRent
extension non-required BOOLEAN auto-extend. default - true
pagination non-required BOOLEAN message pagination, if = false - disabled

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1, item => { checked: false,country: 7,days: 0,extend: {1: 30, 7: 210, 15: 450, 30: 900},hours: 0,messages: {current_page: 1, data: [], from: 1, last_page: 1, per_page: 20, to: 0, total: 0},number: "9313358547",reload: 0,rent: 1,status: 0,time: 19,tzid: 3715}}

Result Description
response 1, if the request is successful, or an error message
item object - rent number

rent Number

Parameter Type Description
checked bool number confirmation
country int country, see parameters
days int the number of days left on rent
extend object Possible renewal options: {1: 30, 7: 210, 15: 450, 30: 900} see extendRentState
hours int number of hours remaining on lease
messages object messages see rent Message
number str tefon number
reload ? int port reboot. 0 - reboot is available. [see portReload](# portReload)
rent int total number of days purchased
status int 0 - number in the process of confirmation, 1 - number confirmed
time int number of minutes remaining on lease
tzid int operation id

rent Message

The structure of the message object. pagination is needed only to form a list, the request will contain all messages at once. Attention, maybe a limit on the number of messages will be added.

Parameter Type Description
current_page int First page
data object in array paginated message array. [[{code: "sms code",created_at: "2019-12-12 10:50:43",id: 1,service: "service", text: "message"}, ...], [{...}, ...],...]
from int First page
last_page int Number of pages
per_page int Number of posts per page
to int number of pages
total int number of messages

getRentState

URL

https://onlinesim.ru/api/rent/getRentState.php?apikey=api_key

List of rented numbers

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/rent/getRentState.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/rent/getRentState.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
tzid non-required INT id of the operation, if you do not pass id, then the method returns the entire list of available operations
pagination non-required BOOLEAN message pagination, if = false - disabled
Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1, list => [..,]}

Result Description
response 1, if the request is successful, or an error message
item an array with all purchased operations, see the description in getRentNum

extendRentState

URL

https://onlinesim.ru/api/rent/extendRentState.php?apikey=api_key&tzid=1&days=30

Renewal of a purchased rent number

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/rent/extendRentState.php?apikey=api_key&tzid=1&days=30",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/rent/extendRentState.php?apikey=api_key&tzid=1&days=30",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
tzid required INT operation id
days required INT Number of days to renew a room. rent Number param extend

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1, item => []}

Result Description
response 1, if the request is successful, or an error message
item Operation. see description in getRentNum

portReload

URL

https://onlinesim.ru/api/rent/portReload.php?apikey=api_key&tzid=1

Rebooting the port, this method only works if the reload parameter of the operation === 0 The method can be used 1 time in 5 minutes.

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/rent/portReload.php?apikey=api_key&tzid=1",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/rent/portReload.php?apikey=api_key&tzid=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
tzid required INT id of the operation

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1}

closeRentNum

URL

https://onlinesim.ru/api/rent/closeRentNum.php?apikey=api_key&tzid=1&days=30

Complete the number, Attention this method completely deletes the number, it will be impossible to restore it.

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/rent/closeRentNum.php?apikey=api_key&tzid=1&days=30",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/rent/closeRentNum.php?apikey=api_key&tzid=1&days=30",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
tzid required INT operation id

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1, item => []}

Result Description
response 1, if the request is successful, or an error message
item Operation. see description in getRentNum

Proxy rent

General description

Api for rent a number

In order to use the API, you need to make a POST or GET request via HTTP to the specified URL: https://onlinesim.ru/api/proxy/{METHOD_NAME}.php

Diagram

Workflow Diagram

tariffs

URL

https://onlinesim.ru/api/proxy/tariffs.php?apikey=api_key

A list of available tariffs for the rent

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/proxy/tariffs.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/proxy/tariffs.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Result

After successful execution, a response will be received in JSON format, as follows:

json {"days":{"config":{"type": {"type","enabled","days":{...}}}, "operators: [...], "connect": [...]}, "traffic": {"config":{"country_code":{"name","cities":{"city_code":"city_name"...},"operators":["operator_code":"operator_name"]}}, "response":1}

getProxy

URL

https://onlinesim.ru/api/proxy/changeType.php?apikey=api_key&count=1&type=shared&connectType=https&operator=all

Getting a proxy

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/proxy/changeType.php?apikey=api_key&count=1&type=shared&connectType=https&operator=all",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/proxy/changeType.php?apikey=api_key&days=1&type=shared&connectType=https&operator=all",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
class non-required STRING type of rental or traffic days, default: days
type required STRING type. shared or sharednowait or private or privatenowait or multiport, for traffic rent not needed
connect required STRING connect type. https or socks, for traffic rent not needed
count required INT rental days [1,7,15,30] or traffic count in gb [1,5,10,15], default: 1
operator non-required STRING operator, default: any. mts,megafon,beeline,tele2
country non-required STRING country_code, see Tariffs, default: any
city non-required STRING city_code, see Tariffs, default: any
port_count non-required STRING The number of ports to Multiport
session non-required BOOLEAN Saving session to traffic rent

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1, item => {...}}

Parameter Name Parameter Data type Description
tzid required INT tzid proxy
item proxy item

proxy item

Parameter Name type Description
tzid int tzid
host string ip
port int порт
user string user
pass string password
change_ip bool Parameter to change ip
check_at string? Proxy Check Date
comment string? Comment
connect_type string connection type
country int country code
created_at int order date
days int Number of rental days
hours int Number of rental hours
ping int ping
operator string operator
rent int Number of rental days
rotate int Change ip
status int Status
stop_at string shutdown date
time int Rental time
type string proxy type
updated_at string Update date

getState

URL

https://onlinesim.ru/api/proxy/getState.php?apikey=api_key

Proxy list

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/proxy/getState.php?apikey=api_key",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/proxy/getState.php?apikey=api_key",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1, list => [..,]}

Parameter Name Parameter Data type Description
tzid required INT tzid proxy
item an array with all purchased operations, see the description in getProxy

changeIp

URL

https://onlinesim.ru/api/proxy/changeIp.php?apikey=api_key&tzid=1

Change ip

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/proxy/changeIp.php?apikey=api_key&tzid=1",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/proxy/changeIp.php?apikey=api_key&tzid=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
tzid required INT your proxy tzid. see getProxy or getState

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1}

Result Description
response 1, if the request is successful, or an error message

changeType

URL

https://onlinesim.ru/api/proxy/changeType.php?apikey=api_key&tzid=1

Change proxy type https -> socks, socks -> https

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/proxy/changeType.php?apikey=api_key&tzid=1",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/proxy/changeType.php?apikey=api_key&tzid=1",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
tzid required INT your proxy tzid. see getProxy or getState

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1, connect_type: type}

Result Description
response 1, if the request is successful, or an error message
connect_type https or socks

setComment

URL

https://onlinesim.ru/api/proxy/setComment.php?apikey=api_key&tzid=1&comment=commentproxy

Comment setting

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/proxy/setComment.php?apikey=api_key&tzid=1&comment=commentproxy",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/proxy/setComment.php?apikey=api_key&tzid=1&comment=commentproxy",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Options

Parameter Name Parameter Data type Description
tzid required INT tzid proxy
comment required STRING Proxy comment

Result

After successful execution, a response will be received in JSON format, as follows:

json {response:1}

Result Description
response 1, if the request is successful, or an error message

Free numbers

General description

Api for rent forward a number

In order to use the API, you need to make a POST or GET request via HTTP to the specified URL: https://onlinesim.ru/api/{METHOD_NAME}.php

Diagram

Workflow Diagram

getFreeCountryList

URL

https://onlinesim.ru/api/getFreeMessageList

List countries for free numbers

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getFreeMessageList",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getFreeMessageList",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response: 1, countries: [{country: 1,country_text: "english"}, {country: 7,country_text: "russia"}, {country: 46,country_text: "english"}]}

Result Description
response 1, if the request has been completed successfully, or an error message
countries countries list

getFreePhoneList

URL

https://onlinesim.ru/api/getFreePhoneList?country=7

List free numbers

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getFreePhoneList?country=7",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getFreePhoneList?country=7",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
country non-required INT Without parameter - 7 (7 - Russia, 86 - China)

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, numbers:...}

Result Description
response 1, if the request has been completed successfully, or an error message
numbers numbers list

getFreeMessageList

URL

https://onlinesim.ru/api/getFreeMessageList?cpage=1&phone=+46700000000

List free messages

Example

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getFreeMessageList?cpage=1&phone=+46700000000",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => "https://onlinesim.ru/api/getFreeMessageList?cpage=1&phone=+46700000000",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ]
));
$response = curl_exec($curl);
curl_close($curl);
var_dump(json_decode($response, true));

Parameters

Name of parameter Parameter Type of data Description
phone required TEXT phone number. format: +7...
page non-required INT page

Result

After the successful completion, you will get a response in the JSON format, in the following form:

json {response:RESPONSE, messages:..}

Result Description
response 1, if the request has been completed successfully, or an error message
messages messages list