$this->api_key, 'action' => 'add'), $data); $result = $this->connect($post); return json_decode($result); } /** * * Order status * */ public function status($order_id) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'status', 'order' => $order_id )); return json_decode($result); } /** * * Order multi status * */ public function multi_status($order_ids) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'status', 'orders' => implode(",", (array)$order_ids) )); return json_decode($result); } /** * * All services * */ public function services() { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'services', )); return json_decode($result); } /** * * Balance * */ public function balance() { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'balance', )); return json_decode($result); } /** * * VTU Services (Airtime & Data plans) * */ public function vtu_services() { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'vtu_services', )); return json_decode($result); } /** * * Purchase VTU (Airtime/Data) * */ public function vtu_buy($data) { $post = array_merge(array('key' => $this->api_key, 'action' => 'vtu_buy'), $data); $result = $this->connect($post); return json_decode($result); } /** * * VTU Order Status * */ public function vtu_status($order_id) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'vtu_status', 'order' => $order_id )); return json_decode($result); } /** * * SocialLog Products * */ public function sociallog_products() { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'sociallog_products', )); return json_decode($result); } /** * * Purchase SocialLog * */ public function sociallog_buy($product_id, $quantity) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'sociallog_buy', 'product_id' => $product_id, 'quantity' => $quantity )); return json_decode($result); } /** * * SocialLog Order Status * */ public function sociallog_status($order_id) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'sociallog_status', 'order' => $order_id )); return json_decode($result); } /** * * SMS Countries List (Global provider support) * */ public function sms_countries() { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'sms_countries' )); return json_decode($result); } /** * * SMS Services * */ public function sms_services($provider, $country = null) { $params = array( 'key' => $this->api_key, 'action' => 'sms_services', 'provider' => $provider ); if ($country !== null) { $params['country'] = $country; } $result = $this->connect($params); return json_decode($result); } /** * * Purchase SMS Number * */ public function sms_buy($provider, $service, $country = null) { $params = array( 'key' => $this->api_key, 'action' => 'sms_buy', 'provider' => $provider, 'service' => $service ); if ($country !== null) { $params['country'] = $country; } $result = $this->connect($params); return json_decode($result); } /** * * SMS Order Status * */ public function sms_status($order_id) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'sms_status', 'order' => $order_id )); return json_decode($result); } /** * * Cancel SMS Number * */ public function sms_cancel($order_id) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'sms_cancel', 'order' => $order_id )); return json_decode($result); } /** * * Connect to panel * */ private function connect($post) { $_post = Array(); if (is_array($post)) { foreach ($post as $name => $value) { $_post[] = $name.'='.urlencode($value); } } if (is_array($post)) { $url_complete = join('&', $_post); } $url = $this->api_url."?".$url_complete; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, 'API (compatible; MSIE 5.01; Windows NT 5.0)'); $result = curl_exec($ch); if (curl_errno($ch) != 0 && empty($result)) { $result = false; } curl_close($ch); return $result; } } // Examples $api = new Api(); # 1. return user balance $balance = $api->balance(); # 2. return all standard SMM services $services = $api->services(); # 3. add order $order = $api->add_order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100)); # Default $order = $api->add_order(array('service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)")); # Custom Comments $order = $api->add_order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60)); # Drip-feed # 4. return SMM status $status = $api->status(23); $statuses = $api->multi_status([12, 2, 13]); # 5. VTU Examples $vtu_list = $api->vtu_services(); // Get list of network rules & data plan service IDs $vtu_order = $api->vtu_buy(array('type' => 'airtime', 'network' => 'mtn', 'phone_number' => '08031234567', 'amount' => 100)); $vtu_status = $api->vtu_status(145); # 6. SocialLog Examples $social_products = $api->sociallog_products(); // Get list of premium accounts $social_order = $api->sociallog_buy('32a875d9e5b72186fa0e928236bd14b2', 1); $social_status = $api->sociallog_status('e30e797e937d5c76c0e5a8a183577d61'); # 7. SMS Verification Examples $sms_countries = $api->sms_countries(); // Get list of supported countries for Global SMS $sms_list = $api->sms_services('server2'); // List available services for USA Server 2 $sms_list_global = $api->sms_services('global', 7); // List available services for Russia (Global ID 7) $sms_order = $api->sms_buy('server2', 'go'); // Rent a number for Google $sms_status = $api->sms_status('62bfd87e02b3c79a...'); // Query received verification code $sms_cancel = $api->sms_cancel('62bfd87e02b3c79a...'); // Cancel number if no code received