API

Unganisha paneli au programu yako na LiberLite. Inaendana na API v2 ya kawaida ya paneli za SMM, hivyo programu za wauzaji zilizopo zinafanya kazi kwa kubadilisha URL na ufunguo.

Mbinu ya HTTPPOST
URL ya APIhttps://liberlite.com/api/v2
Ufunguo wa APIPata kwenye ukurasa wa Akaunti
Muundo wa jibuJSON

Service list

VigezoMaelezo
keyYour API key
actionservices

Mfano wa jibu

[
    {
        "service": 1,
        "name": "Followers",
        "type": "Default",
        "category": "First Category",
        "rate": "0.90",
        "min": "50",
        "max": "10000",
        "refill": true,
        "cancel": true,
        "dripfeed": false
    },
    {
        "service": 2,
        "name": "Comments",
        "type": "Custom Comments",
        "category": "Second Category",
        "rate": "8",
        "min": "10",
        "max": "1500",
        "refill": false,
        "cancel": true,
        "dripfeed": false
    }
]

Add order

VigezoMaelezo
keyYour API key
actionadd
serviceService ID
linkLink to page
quantityNeeded quantity
runs (optional)Runs to deliver
interval (optional)Interval in minutes

Mfano wa jibu

{
    "order": 23501
}

Order status

VigezoMaelezo
keyYour API key
actionstatus
orderOrder ID

Mfano wa jibu

{
    "charge": "0.27819",
    "start_count": "3572",
    "status": "Partial",
    "remains": "157",
    "currency": "USD"
}

Multiple orders status

VigezoMaelezo
keyYour API key
actionstatus
ordersOrder IDs (separated by a comma, up to 100 IDs)

Mfano wa jibu

{
    "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"
    }
}

Create refill

VigezoMaelezo
keyYour API key
actionrefill
orderOrder ID

Mfano wa jibu

{
    "refill": "1"
}

Create multiple refill

VigezoMaelezo
keyYour API key
actionrefill
ordersOrder IDs (separated by a comma, up to 100 IDs)

Mfano wa jibu

[
    {
        "order": 1,
        "refill": 1
    },
    {
        "order": 2,
        "refill": 2
    },
    {
        "order": 3,
        "refill": {
            "error": "Incorrect order ID"
        }
    }
]

Get refill status

VigezoMaelezo
keyYour API key
actionrefill_status
refillRefill ID

Mfano wa jibu

{
    "status": "Completed"
}

Get multiple refill status

VigezoMaelezo
keyYour API key
actionrefill_status
refillsRefill IDs (separated by a comma, up to 100 IDs)

Mfano wa jibu

[
    {
        "refill": 1,
        "status": "Completed"
    },
    {
        "refill": 2,
        "status": "Rejected"
    },
    {
        "refill": 3,
        "status": {
            "error": "Refill not found"
        }
    }
]

Create cancel

VigezoMaelezo
keyYour API key
actioncancel
ordersOrder IDs (separated by a comma, up to 100 IDs)

Mfano wa jibu

[
    {
        "order": 9,
        "cancel": {
            "error": "Incorrect order ID"
        }
    },
    {
        "order": 2,
        "cancel": 1
    }
]

User balance

VigezoMaelezo
keyYour API key
actionbalance

Mfano wa jibu

{
    "balance": "100.84292",
    "currency": "USD"
}

Mfano wa msimbo wa PHP

Nakili darasa hili kwenye mradi wako na weka ufunguo wako wa API.

<?php
class Api
{
    /** API URL */
    public $api_url = 'https://liberlite.com/api/v2';

    /** Your API key */
    public $api_key = '';

    /** Add order */
    public function order($data)
    {
        $post = array_merge(['key' => $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 orders status */
    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 order */
    public function refill(int $orderId)
    {
        return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill', 'order' => $orderId]));
    }

    /** Refill orders */
    public function multiRefill(array $orderIds)
    {
        return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill', 'orders' => implode(',', $orderIds)]), true);
    }

    /** Get refill status */
    public function refillStatus(int $refillId)
    {
        return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill_status', 'refill' => $refillId]));
    }

    /** Get refill statuses */
    public function multiRefillStatus(array $refillIds)
    {
        return json_decode($this->connect(['key' => $this->api_key, 'action' => 'refill_status', 'refills' => implode(',', $refillIds)]), true);
    }

    /** Cancel orders */
    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/5.0 (compatible; SMM-API-Client)');
        $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(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 2, 'interval' => 5]); # Default

$order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)"]); # Custom Comments

$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']); # Package

$order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60]); # Drip-feed

$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

$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

$refill = (array) $api->multiRefill([1, 2]);
$refillIds = array_column($refill, 'refill');
if ($refillIds) {
    $refillStatuses = $api->multiRefillStatus($refillIds);
}
Ya hali ya juu: REST API v1 (maagizo ya pamoja, funguo za idempotency)

API ya JSON REST inayoweza kuweka huduma kadhaa kwa kiungo kimoja katika agizo moja. Maelezo kamili: OpenAPI JSON

curl -X POST https://liberlite.com/api/v1/orders \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: campaign-001" \
  -d '{"items":[{"service_id":1,"link":"https://instagram.com/p/XYZ","quantity":1000},{"service_id":3,"link":"https://instagram.com/p/XYZ","quantity":1000}]}'