Developer API Documentation
REST API for automating shortlink creation, app integration, and mass shrinker.
Table of Contents
1. Autentikasi
Semua request API membutuhkan header:
X-Api-Key: sl_xxxxxxxxxxxxxxxx
API key tersedia di Dashboard setelah login. Jangan commit API key ke repository publik.
Rate limit: 60 request/menit per API key. Response error 429 jika melebihi.
2. GET /api/v1/links
Mengembalikan daftar shortlink milik akun Anda.
GET https://earnlinkfly.my.id/api/v1/links X-Api-Key: sl_your_key
Response: JSON array berisi slug, url tujuan, statistik klik.
3. POST /api/v1/links
Membuat shortlink baru.
POST https://earnlinkfly.my.id/api/v1/links
Content-Type: application/json
X-Api-Key: sl_your_key
{
"url": "https://example.com/halaman",
"slug": "custom-opsional",
"title": "Judul opsional",
"mode": "both"
}mode: both | paid_only | free_only
4. POST Bulk Import
POST https://earnlinkfly.my.id/api/v1/links
Content-Type: application/json
{
"bulk": true,
"urls": ["https://a.com", "https://b.com"],
"mode": "both"
}5. GET /api/v1/api-key
Mengembalikan API key Anda. Membutuhkan session login (cookie), bukan API key.
6. Webhook Pembayaran
Callback WijayaPay terpusat: https://klankomik.site/webhook-api/wijayapay
Ref ID format SL- untuk routing otomatis ke earnlinkfly.my.id/api/payment/callback/wijayapay.
7. Kode Error
| Kode | Arti |
|---|---|
| 200 | Sukses |
| 400 | Request tidak valid |
| 401 | API key salah/tidak ada |
| 429 | Rate limit |
| 500 | Server error |
8. Export CSV
Endpoint export (header X-Api-Key):
GET /api/v1/export/linksGET /api/v1/export/clicks?from=2026-06-01&to=2026-06-30GET /api/v1/export/earnings
9. API Playground
Uji request langsung dari browser. API key disimpan lokal di browser Anda (localStorage).
Response akan muncul di sini…
Log in to pre-fill your API key.
Butuh bantuan integrasi? ' . e(__('contact.heading', 'Hubungi tim developer')) . ' — pilih subjek "API / Developer".