$this->api_key, 'action' => 'add'], $data); return json_decode((string) $this->connect($post)); } /** Get order status */ public function status($order_id) { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'status', 'order' => $order_id])); } /** Get the status of several orders (up to 100) */ public function multiStatus($order_ids) { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'status', 'orders' => implode(',', (array) $order_ids)])); } /** Get services */ public function services() { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'services'])); } /** Refill an order */ public function refill(int $orderId) { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill', 'order' => $orderId])); } /** Refill several orders (up to 100) */ public function multiRefill(array $orderIds) { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill', 'orders' => implode(',', $orderIds)]), true); } /** Get a refill's status */ public function refillStatus(int $refillId) { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill_status', 'refill' => $refillId])); } /** Get the status of several refills (up to 100) */ public function multiRefillStatus(array $refillIds) { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill_status', 'refills' => implode(',', $refillIds)]), true); } /** Cancel orders (up to 100) */ public function cancel(array $orderIds) { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'cancel', 'orders' => implode(',', $orderIds)]), true); } /** Get balance */ public function balance() { return json_decode($this->connect(['key' => $this->api_key, 'action' => 'balance'])); } private function connect($post) { $ch = curl_init($this->api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (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(); $services = $api->services(); # All services $balance = $api->balance(); # Your balance // Add order (use the "type" of the service from the services list) $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100]); # Default $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60]); # Default, drip-feed (services with "dripfeed": true) $order = $api->order(['service' => 1, 'link' => 'http://example.com/test']); # Package $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)"]); # Custom Comments (one per line) $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'usernames' => "test\ntesting"]); # Mentions $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'usernames' => "test, testing", 'hashtags' => "#goodphoto"]); # Mentions with Hashtags $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'usernames' => "test\nexample\nfb"]); # Mentions Custom List $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'hashtag' => "test"]); # Mentions Hashtag $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'username' => "test"]); # Mentions User Followers $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'media' => "http://example.com/p/Ds2kfEr24Dr"]); # Mentions Media Likers $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'username' => "test"]); # Comment Likes $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'answer_number' => '7']); # Poll $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'username' => 'test', 'comments' => "good pic\ngreat photo"]); # Comment Replies $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'keywords' => "test\ntesting"]); # SEO $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'country' => 'US', 'device' => 1, 'type_of_traffic' => 1, 'google_keyword' => 'test']); # Web Traffic (device 1-5, type_of_traffic 1 Google keyword / 2 referring_url / 3 blank) $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'groups' => "group1\ngroup2"]); # Invites from Groups $order = $api->order(['service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'posts' => 5, 'delay' => 30, 'expiry' => '11/11/2027']); # Subscriptions: 5 new posts $order = $api->order(['service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'old_posts' => 5, 'delay' => 30]); # Subscriptions: the last 5 published posts $status = $api->status($order->order); # Order status $statuses = $api->multiStatus([1, 2, 3]); # Several orders $refill = (array) $api->multiRefill([1, 2]); $refillIds = array_column($refill, 'refill'); if ($refillIds) { $refillStatuses = $api->multiRefillStatus($refillIds); } $cancel = $api->cancel([1, 2]); # Cancel orders