Viewing file: Reelsms_api.php (6.17 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Reelsms_api {
public $data;
public function getBalance() { $url = "https://api.turksmsonay.com/api/e9ff613fa568f4659a754ecf86e34833/BalanceCheck"; $arrContextOptions = array( "ssl" => array( "verify_peer" => false, "verify_peer_name" => false, ), );
$data = file_get_contents($url, false, stream_context_create($arrContextOptions)); $this->data = json_decode($data, true); return $this->data; }
public function get_number($country, $service) { $api_key = "e9ff613fa568f4659a754ecf86e34833"; $c_name = explode(":",$country)[1]; $url = "https://api.turksmsonay.com/api/$api_key/NumberGet/$country/$service"; $arrContextOptions = array( "ssl" => array( "verify_peer" => false, "verify_peer_name" => false, ), ); $res = file_get_contents($url, false, stream_context_create($arrContextOptions));
$cat = json_decode($res, true);
if($res != "Country Not Found." && $res != "App Not Found." && $res != "Not Enough balance" && $res != "No free channels available check after sometime.") { return array(
"id" => $res.":".$c_name.":".$service,
"number" => "+".$cat["number"],
"error_code" => 200
);
}
else {
$error_code = 400;
return array(
"id" => 0,
"number" => null,
"error_code" => $error_code
);
}
}
public function get_message($id) { $data = explode(":", $id);
$number = $data[3];
$country = "Turkey";
$service = $data[5];
$api_key = "e9ff613fa568f4659a754ecf86e34833";
$numere = str_replace('"', "", $number);
$url = "https://api.turksmsonay.com/api/$api_key/SmsGet/$country/$service/$numere";
$url = str_replace('}', "", $url);
$curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); $dataxx = curl_exec($curl);
$res_obj = json_decode($dataxx, true);
if($service=="hopi"){ $codex = substr($res_obj["code"], 42);
$vers = substr($codex, 0,6);
}
if($service=="getir"){ $codex = substr($res_obj["code"], 43);
$vers = substr($codex, 0,4);
}
$orp = $res_obj["code"];
if($orp!="error") {
return array(
"code" => $res_obj["code"]
);
} else {
return array(
"code" => null
);
}
}
public function get_service_price($service) { $api_key = "e9ff613fa568f4659a754ecf86e34833"; $url = "https://api.turksmsonay.com/api/$api_key/NumberPrice/$service/"; $arrContextOptions = array( "ssl" => array( "verify_peer" => false, "verify_peer_name" => false, ), ); $data = json_encode(file_get_contents($url, false, stream_context_create($arrContextOptions))); return $this->data = json_decode($data, true); }
public function get_services_by_country($country) { $services = array( array("name" => "hopi"), array("name" => "trendyol"), array("name" => "getir"), array("name" => "yemeksepeti"), array("name" => "sahibinden"), array("name" => "papara"), array("name" => "istegelsin"), array("name" => "ciceksepeti"), array("name" => "tinder"), array("name" => "google"), array("name" => "kazandirio"), array("name" => "vodafone"), array("name" => "telegram"), array("name" => "papara"), array("name" => "okx"), array("name" => "bip"), array("name" => "gamesatis"), array("name" => "itemsatis"), array("name" => "ininal") );
$api_key = "e9ff613fa568f4659a754ecf86e34833"; $url = "https://api.turksmsonay.com/api/$api_key/serviceList/$country"; $arrContextOptions = array( "ssl" => array( "verify_peer" => false, "verify_peer_name" => false, ), ); $json = json_decode(file_get_contents($url, false, stream_context_create($arrContextOptions))); foreach($services as $service) { array( "name" => $service["name"]); } return $services; }
public function get_service_stock($country ="turkey", $service) {
$url= "https://api.turksmsonay.com/api/test/NumberStocks/$country/$service"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); $data = curl_exec($curl); $json = json_decode($data, true);
return $json['stock']; }
public function get_countries(){ $countries = array( array("id" => "turkey", "name" => "Türkiye"), );
return $countries;
}
public function cancel_number($number_id){ $data = explode(":", $number_id);
$number = $data[0];
$service = $data[2];
$api_key = "e9ff613fa568f4659a754ecf86e34833"; $url = "https://api.turksmsonay.com/api/$api_key/NumberCancel/$service/$number"; $arrContextOptions = array( "ssl" => array( "verify_peer" => false, "verify_peer_name" => false, ), ); $data = file_get_contents($url, false, stream_context_create($arrContextOptions)); $this->data = json_decode($data, true); return $this->data; } } ?>
|