NAV undefined

SMS Reception

Example of requests

Specially for you, we have prepared several examples for postman

Run in Postman

docs in postmen

General description

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

getNumbersStats

To obtain the relevant statistics by country and number

Example

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

// ajax

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);
});

statistics on numbers

Parameters

Name of parameter Parameter Type of data Description
country non-required INT Without parameter - 7
7 - Russland
86 - China
49 - Deutschland
357 - Zypern
34 - Spanien
32 - Belgien
33 - Frankreich
44 - Großbritannien
63 - Philippines
380 - Ukraine
77 - Kasachstan
420 - Czech
48 - Polen
43 - Österreich
381 - Serbien
371 - Lettland
372 - Estland
373 - Moldawien
998 - Usbekistan
967 - Jemen
234 - Nigeria
509 - Haiti
225 - Elfenbeinküste

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

getServiceList

stats only for russian. deprecated, use getNumbersStats

Example

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

// ajax

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

$.ajax(settings).done(function (response) {
console.log(response);
});

It returns the services that are available for order, the cost of all the types of reception, the percentage of available numbers

Result

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

json [ { "id": "0", "slug": "VKcom", "title": "VKontakte", "index": "14", "repeat": "8", "deferr": "12", "limit": "50" }, { "id": "1", "slug": "3223", "title": "Facebook", "index": "4", "repeat": "5", "deferr": "3", "limit": "50" }, ... ]

Parameter Description
id Service ID
slug Service name
title Service title
index Cost of online SMS reception in RUR
repeat Cost of repeated SMS reception in RUR
deferr Cost of delayed SMS reception in RUR
limit Percentage of available numbers from the total quantity of numbers

getState

Example

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

// ajax

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);
});

It returns the state for the selected operation or all operation

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

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, delayed reception — deferr)
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.

getOperations

Example

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

// ajax

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

$.ajax(settings).done(function (response) {
console.log(response);
});

It returns the list and the state for all operations.

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 [{"tzid":"219","service":"vk","number":"+79670663128","form":"index","time":1172,"response":"TZ_NUM_WAIT"},{"tzid":"220","service":"whatsapp","response":"TZ_INPOOL","form":"deferr","time":0}]

The parameter values are the same as in the getState method.

getNum

Example

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

// ajax

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);
});

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

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. Takes on one of the values, both variants can be transmitted: 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
7 - Russland
86 - China
49 - Deutschland
357 - Zypern
34 - Spanien
32 - Belgien
33 - Frankreich
44 - Großbritannien
63 - Philippines
380 - Ukraine
77 - Kasachstan
420 - Czech
48 - Polen
43 - Österreich
381 - Serbien
371 - Lettland
372 - Estland
373 - Moldawien
998 - Usbekistan
967 - Jemen
234 - Nigeria
509 - Haiti
225 - Elfenbeinküste
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.

Services

Variant 1 Variant 2 Website (service) name
VKcom vk Вконтакте
3223 facebook Facebook
MailRu mailru MailRu
Odklru classmates Одноклассники
Google gmail Google
Yandex yandex Yandex
Avito avito Avito
Youla youla Youla
Viber viber Viber
WhatsApp whatsapp WhatsApp
Telegram telegram Telegram
FastFriend drugvokrug ДругВокруг
Instagram instagram Instagram
WeChat wechat WeChat
Steam steam Steam
Uber uber Uber
Microsoft microsoft Microsoft
7 other Другие сайты

Additional services

Neme of service Discription
unlimited_sms Unlimited messages for 20 minutes
unlimited_sms_three_days Unlimited messages for 3 days

** 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

getNumRepeat

Example

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

// ajax

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);
});

It creates a request for repeated use of the virtual number

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

getForward

Example

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

// ajax

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);
});

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

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

setOperationOk

Example

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

// ajax

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);
});

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

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

setForwardStatusEnable

Example

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

// ajax

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

$.ajax(settings).done(function (response) {
console.log(response);
});

It confirms forwarding

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

setOperationRevise

Example

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

// ajax

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);
});

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.

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;

getBalance

Example

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

// ajax

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);
});

It returns information on the balance.

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, "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.

getService

Example

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

// ajax

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);
});

Getting the list of services for a repeat order of SMS

Parameters

o

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 ДругВокруг
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.

getServiceNumber

Example

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

// ajax

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);
});

It gets the list of numbers for the specified service.

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

forwardingList

Example

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

// ajax

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);
});

It displays the list of all forwardings

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

Example

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

// ajax

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

$.ajax(settings).done(function (response) {
console.log(response);
});

It changes the forwarding parameters

Parameters

Name of parameter Parameter Type of data Description
id required INT unique number of the forwarding obtained using the forwardingList method
minutes non-required INT minimum number of minutes required for a conversation that is automatically supported by the service, 0 - disable auto-replenishment
auto non-required BOOL true/false - set up/disable auto-extension for the virtual number,
forward_number non-required INT the telephone number, which the forwarding has been set up to
max_minutes non-required INT total amount of auto-replenishments. Auto-replenishment is disabled after it is reached

Result

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

json {"response": RESPONSE}

forwardingRemove

Example

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

// ajax

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);
});

It deletes (disables) the forwarding

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

Example

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

// ajax

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);
});

It displays the list of all forwardings calls

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

getForwardPaymentsList

Example

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

// ajax

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

$.ajax(settings).done(function (response) {
console.log(response);
});

It displays the list of all automatic payments

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,forwardPaymentsList: [......]}

Parameter Description
forwardPaymentsList array of the list of payments, and data on each payment

json {"id":10545,"forward_id":12048,"number":9811957337,"sum":13,"status":3,"created_at":"2016-12-26 12:38:04"},...

Name of parameter Description
id unique number of payment
forward_id unique number of forwarding
number virtual number, which the forwarding has been set up from
sum replenishment amount including the commission fee
status current status of the payment:
1 - Created
2 - Sent to payment
3 - Credited
created_at date and time of payment creation

getFreeCountryList

Example

https://onlinesim.ru/api/getFreeCountryList?page=1&phone=+46700000000

// ajax

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);
});

List countries for free numbers

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

Example

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

// ajax

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);
});

List free messages

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

Example

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

// ajax

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);
});

List free messages

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

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: http://onlinesim.ru/api/rent/ {METHOD_NAME} .php

getRentNum

Getting a number

Example

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

// ajax

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);
});

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

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

List of rented numbers

Example

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

// ajax

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);
});

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

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

Renewal of a purchased rent number

Example

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

// ajax

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);
});

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

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

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

// ajax

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);
});

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}

tariffsRent

Tariffs and other parameters.

Example

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

// ajax

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);
});

Options

Parameter Name Parameter Data type Description
country тщт-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, ...}

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: http://onlinesim.ru/api/proxy/ {METHOD_NAME} .php

getProxy

Getting a proxy

Example

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

// ajax

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

$.ajax(settings).done(function (response) {
    console.log(response);
});

Options

Parameter Name Parameter Data type Description
type required STRING type. shared or private or privatenowait or multiport
connectType required STRING connect type. https or socks
days required INT rental days. 1,7,15,30
operator non-required INT operator, default: all. mts,megafon,beeline,tele2

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

Proxy list

Example

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

// ajax

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);
});

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

Change ip

Example

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

// ajax

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

$.ajax(settings).done(function (response) {
    console.log(response);
});

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

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

Example

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

// ajax

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);
});

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

Comment setting

Example

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

// ajax

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);
});

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