All articles Social Media

Example

SocialBar Team · Oct 01, 2024 · 2 min read

$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); } /** * * 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(); # return all services $services = $api->services(); # return user balance $balance = $api->balance(); // add order $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100)); # Default $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)")); # Custom Comments $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60)); # Drip-feed # return status, charge, remains, start count, order_id $status = $api->status(23); # return orders status, charge, remains, start count, order_id $statuses = $api->multi_status([12, 2, 13]);

Article FAQ

What does this article cover?

"Example" explains practical social media strategies you can apply from the SocialBar blog.

Is this guide beginner-friendly?

Yes. We write for creators and small teams — step-by-step where it helps, without unnecessary jargon.

Can I share this article?

You may link to this page freely. Please credit SocialBar when republishing excerpts.

How do I put these tips into action?

Use the service links in the article or browse SocialBar packages for followers, likes, views and engagement.

Need help with an order after reading?

Contact SocialBar support with your order ID — the team can clarify delivery, refills and package choice.

Support Chat on WhatsApp