URL
https://onlinesim.io/api/getState.php?apikey=APIKEY
It returns the state for the selected operation or all operation
Example
- javascript
var settings = {
"async": true,
"crossDomain": true,
"url": "https://onlinesim.io/api/getState.php?apikey=APIKEY",
"method": "GET",
"headers": {"accept": "application/json"}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
- php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://onlinesim.io/api/getState.php?apikey=APIKEY",
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 |
---|---|---|---|
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 |
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) |
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. |
.
/demo/api/getState.php?apikey=APIKEY
The method will return generated test data.