Untuk reseller dan integrasi otomatis. Buat API key di dasbor dengan izin seperlunya.
Kirim key di header Authorization: Bearer sk_.... Batas 120 permintaan per menit per key; melebihinya memberi status 429. Key hanya ditampilkan sekali saat dibuat dan dapat dicabut kapan saja.
| Metode | Path | Scope | Keterangan |
|---|---|---|---|
| GET | /api/v1/catalog/services?country=ID | catalog:read | Daftar layanan aktif beserta harga akhir. |
| GET | /api/v1/wallet | wallet:read | Saldo dan status dompet. |
| POST | /api/v1/activations | activations:write | Membeli nomor. Body: {"serviceId": "..."}. Wajib header Idempotency-Key. |
| GET | /api/v1/activations | activations:read | Daftar aktivasi Anda (nomor disamarkan). |
| GET | /api/v1/activations/{id} | activations:read | Status satu aktivasi dan nomor lengkap. |
| GET | /api/v1/activations/{id}/messages | activations:read | Pesan SMS/kode yang masuk. |
| POST | /api/v1/activations/{id}/cancel | activations:write | Membatalkan sebelum kode diterima; dana kembali. |
# 1. Lihat katalog
curl -s https://familyhosting.web.id/api/v1/catalog/services \
-H "Authorization: Bearer sk_..."
# 2. Beli nomor (Idempotency-Key unik per pesanan; kirim ulang kunci yang sama aman)
curl -s -X POST https://familyhosting.web.id/api/v1/activations \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-0001" \
-d '{"serviceId":"<id-layanan>"}'
# 3. Ambil kode (poll tiap 5-10 detik sampai status SMS_RECEIVED)
curl -s https://familyhosting.web.id/api/v1/activations/<id>/messages \
-H "Authorization: Bearer sk_..."Respons sukses berbentuk {"data": ...}; galat berbentuk {"error": {"code", "message", "requestId"}}. Sertakan requestId saat menghubungi dukungan.