NAV undefined

SMS Reception

Example of requests

Specially for you, we have prepared several examples for postman

Run in Postman

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. "en" - English; "ru" - Russian;

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

Encryption

In these methods, register and login, the password parameter is transmitted in an encrypted form using the RSA algorithm, the encryption procedure is the following:

  1. Get a public key: /api/public.pem
  2. Encrypt the password using this key;
  3. Wrap the result around base64;

Example of a PHP code

$key = openssl_get_publickey('key');
openssl_public_encrypt('password', $password, $key);
$password = base64_encode($password);

Authorization - login

Example

https://onlinesim.ru/api/login.php

body: {
    username: username
    password: password
    dev_key: dev_key
}

// ajax

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/login.php",
    "method": "POST",
    "data" : {
       "username": "username",
       "password": "password",
       "dev_key": "Ключ доступен только для разработчиков, обратитесь в тех. поддержку",
    },
    "headers": {
        "accept": "application/json"
    }
}

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

User authorization, getting apikey, POST request, all the parameters must be transmitted in the request body

Name of parameter Parameter Type of data Description
username required TEXT username
password required TEXT password in encrypted form, see Encryption
dev_key required TEXT

Result

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

json {"response":"1","active":"true"}

Result Description
response 1, if the request has been completed successfully, or an error message
active true - email address confirmation required, false - not required

RESPONSE

Result Description
TIME_ERROR You have exceeded the number of registration requests allowed
ERROR_ACCOUNT_NOT_ACTIVATE The email address has not been confirmed
LOGIN_ERROR Wrong login or password
"email": [ "The email address field is required."],.. Reference to missing or non-matching data

Registration - register

New user registration, POST request, all the parameters must be transmitted in the request body

Example

https://onlinesim.ru/api/register.php

body: {
    name: name
    username: username
    email: email
    password: password
    password_confirmation: password
    dev_key: dev_key
    terms: true
}

// ajax

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/login.php",
    "method": "POST",
    "data" : {
       "username": "username",
       "password": "password",
       "name": "name",
       "email": "email",
       "password": "password",
       "password_confirmation": "password",
       "terms": true,
       "dev_key": "Ключ доступен только для разработчиков, обратитесь в тех. поддержку",
    },
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
console.log(response);
});
Name of parameter Parameter Type of data Description
name required TEXT full name
username required TEXT username
email required TEXT email
password required TEXT password in encrypted form, see Encryption, minimum number of symbols: 10, TEXT (string type)
password_confirmation required TEXT confirmation of password in encrypted form, see Encryption, minimum number of symbols: 10, TEXT (string type)
dev_key required TEXT
terms required BOOL agreement to follow the service's rules, true/false - agree/do not agree

Result

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

json {"response":"1","active":"true"}

Result Description
response 1, if the request has been completed successfully, or an error message
active true - email address confirmation required, false - not required

RESPONSE

Result Description
TIME_ERROR You have exceeded the number of registration requests allowed
"email": [ "The email address field is required."],.. Reference to missing or non-matching data

getServiceList

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

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 [ { "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

Parameters

Name of parameter Parameter Type of data Description
tzid required INT operation identifier
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 mumbers
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 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 - Russia, 86 - China, 234 - Нигерия, 20 - Египет, 380 - Украина, 77 - Казахстан)
reject non-required ARRAY Array mask reject, Example: [911,912123] reject all numbers, start at 911* and 912123*.

Services

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

Additional services

Neme of service Discription
unlimited_sms Unlimited messages

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

getPhoneList

Example

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

// ajax

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getPhoneList?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

getMessageList

Example

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

// ajax

var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://onlinesim.ru/api/getMessageList?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