API belgeleri
API'miz piyasanın standart biçimini izler: her çağrı bir POST isteğidir ve tek bir adrese gönderilir; anahtarınız (key) ve bir işlem (action) belirtilir. Mevcut bayi betikleri bu nedenle değişiklik yapılmadan uyumludur. Anahtarınızı hesabınızdaki "API" bölümünden oluşturun.
Adres: https://sociallikeyou.com/api/v2
Yöntem: POST · Yanıt: JSON
Liste des services
| Parametre | Açıklama |
|---|---|
key | API anahtarınız |
action | services |
Örnek yanıt
[{"service":1,"name":"…","type":"Default","category":"…","rate":"0.9","min":"10","max":"10000","refill":false,"cancel":false}]
Passer une commande
| Parametre | Açıklama |
|---|---|
key | API anahtarınız |
action | add |
service | ID du service |
link | Lien |
quantity | Quantité |
idempotency_key | Facultatif : identifiant unique pour éviter les doublons en cas de nouvel essai |
Örnek yanıt
{"order":23501}
Statut d’une commande
| Parametre | Açıklama |
|---|---|
key | API anahtarınız |
action | status |
order | ID de la commande |
Örnek yanıt
{"charge":"0.27819","start_count":"3572","status":"Partial","remains":"157","currency":"EUR"}
Statut de plusieurs commandes (100 max)
| Parametre | Açıklama |
|---|---|
key | API anahtarınız |
action | status |
orders | IDs séparés par des virgules |
Örnek yanıt
{"1":{"charge":"0.27","start_count":"0","status":"Completed","remains":"0","currency":"EUR"},"10":{"error":"Incorrect order ID"}}
Solde du compte
| Parametre | Açıklama |
|---|---|
key | API anahtarınız |
action | balance |
Örnek yanıt
{"balance":"100.84","currency":"EUR"}
REST API (JSON) ve bildirimler
Yeni geliştirmeler için bir REST API şu adreste kullanılabilir: https://sociallikeyou.com/api/rest/v1 şu başlıkla: Authorization: Bearer API_ANAHTARINIZ : GET /services, GET /balance, GET /orders, GET /orders/{id} ve POST /orders. Oluşturma işlemi şu başlığı gerektirir: Idempotency-Key; böylece bir kesintiden sonra yapılan yeni deneme asla mükerrer kayıt oluşturmaz. OpenAPI biçiminde tam belirtim: openapi.json.
Bildirimler: hesabınızda (API bölümü) bir HTTPS adresi belirtin. Her durum değişikliğinde şunu göndeririz: POST JSON isteği, şu başlıkla: X-Webhook-Signature: t=…,v1=…. Doğrulamak için şu değerin HMAC-SHA256'sını t.corps gizli anahtarınızla hesaplayın. Başarısız olursa gönderim yaklaşık 24 saat boyunca 10 kereye kadar yeniden denenir.
Hatalar
İş mantığı hataları şunu döndürür: {"error": "message"}. Geçersiz anahtar: HTTP 401. Çok fazla istek: HTTP 429 (varsayılan sınır: anahtar başına dakikada 120 istek).
Örnekler
PHP
<?php
$ch = curl_init("https://sociallikeyou.com/api/v2");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
"key" => "VOTRE_CLE", "action" => "add",
"service" => 1, "link" => "https://exemple.com/page", "quantity" => 1000,
]),
]);
$reponse = json_decode(curl_exec($ch), true);
Python
import requests
r = requests.post("https://sociallikeyou.com/api/v2", data={"key": "VOTRE_CLE", "action": "balance"}, timeout=30)
print(r.json())
JavaScript (Node.js)
const r = await fetch("https://sociallikeyou.com/api/v2", {
method: "POST",
body: new URLSearchParams({ key: "VOTRE_CLE", action: "services" }),
});
console.log(await r.json());