Xml api
-
Merhabalar business hesap açsam. Xml api çekebiliyor muyum açacağım siteye
Api örneği smm panel diye anılan panellerden çekilecektir. Panelde api çekmek için gösterilen örnek aşağıdadır. Xml formatın altında da php format örneği bulunmaktadır.
HTTP Method POST
API URL https://sosyalpazarci.com/api/v2
API Key c89ae026407aa5c9fc6f7cfd48b01372
Response format JSONService list
Parameters Description
key Your API key
action servicesExample response
[
{
‘service’: 1,
‘name’: ‘Followers’,
‘type’: ‘Default’,
‘category’: ‘First Category’,
‘rate’: ‘0.90’,
‘min’: ’50’,
‘max’: ‘10000’
},
{
‘service’: 2,
‘name’: ‘Comments’,
‘type’: ‘Custom Comments’,
‘category’: ‘Second Category’,
‘rate’: ‘8’,
‘min’: ’10’,
‘max’: ‘1500’
}
]Add order
(Default/Package/Subscriptions) (1 i seçileccek)
Parameters Description
key Your API key
action add
service Service ID
link Link to page
quantity Needed quantity
runs (optional) Runs to deliver
interval (optional) Interval in minutesExample response
{
‘order’: 23501
}Order status
Parameters Description
key Your API key
action status
order Order IDExample response
{
‘charge’: ‘0.27819’,
‘start_count’: ‘3572’,
‘status’: ‘Partial’,
‘remains’: ‘157’,
‘currency’: ‘USD’
}Multiple orders status
Parameters Description
key Your API key
action status
orders Order IDs separated by commaExample response
{
‘1’: {
‘charge’: ‘0.27819’,
‘start_count’: ‘3572’,
‘status’: ‘Partial’,
‘remains’: ‘157’,
‘currency’: ‘USD’
},
’10’: {
‘error’: ‘Incorrect order ID’
},
‘100’: {
‘charge’: ‘1.44219’,
‘start_count’: ‘234’,
‘status’: ‘In progress’,
‘remains’: ’10’,
‘currency’: ‘USD’
}
}User balance
Parameters Description
key Your API key
action balanceExample response
{
‘balance’: ‘100.84292’,
‘currency’: ‘USD’
}PHP örnek
$this->api_key, ‘action’ => ‘add’), $data);
return json_decode($this->connect($post));
}public function status($order_id) { // get order status
return json_decode($this->connect(array(
‘key’ => $this->api_key,
‘action’ => ‘status’,
‘order’ => $order_id
)));
}public function multiStatus($order_ids) { // get order status
return json_decode($this->connect(array(
‘key’ => $this->api_key,
‘action’ => ‘status’,
‘orders’ => implode(‘,’, (array)$order_ids)
)));
}public function services() { // get services
return json_decode($this->connect(array(
‘key’ => $this->api_key,
‘action’ => ‘services’,
)));
}public function balance() { // get balance
return json_decode($this->connect(array(
‘key’ => $this->api_key,
‘action’ => ‘balance’,
)));
}private function connect($post) {
$_post = Array();
if (is_array($post)) {
foreach ($post as $name => $value) {
$_post[] = $name.’=’.urlencode($value);
}
}$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_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if (is_array($post)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, join(‘&’, $_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(); # return all services
$balance = $api->balance(); # return user 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’)); # Package
$order = $api->order(array(‘service’ => 1, ‘link’ => ‘http://example.com/test’, ‘quantity’ => 100, ‘runs’ => 10, ‘interval’ => 60)); # Drip-feed
$order = $api->order(array(‘service’ => 1, ‘username’ => ‘username’, ‘min’ => 100, ‘max’ => 110, ‘posts’ => 0,’delay’ => 30)); # Subscriptions
$status = $api->status($order->order); # return status, charge, remains, start count, currency
$statuses = $api->multiStatus([1, 2, 3]); # return orders status, charge, remains, start count, currency
Yardım istediğim blog (yalnızca oturum açmış kullanıcılar tarafından görülebilir).
- ‘Xml api’ konusu yeni yanıtlara kapalı.