Skip to main content

Authentication

LeuwongRR User API menggunakan User API Token dengan skema Bearer Token. Setiap endpoint user wajib mengirim header berikut:
Authorization: Bearer YOUR_USER_API_TOKEN
Accept: application/json

Format request

curl -H "Authorization: Bearer YOUR_USER_API_TOKEN" \
  -H "Accept: application/json" \
  https://leuwongrr.online/api/v1/me

Validate token

Gunakan endpoint berikut untuk mengecek apakah token masih aktif dan dapat dipakai.
POST /api/v1/auth/token/validate
curl -X POST "https://leuwongrr.online/api/v1/auth/token/validate" \
  -H "Authorization: Bearer YOUR_USER_API_TOKEN" \
  -H "Accept: application/json"

Endpoint public

Endpoint berikut tidak membutuhkan token:
GET /api/v1/health
GET /api/v1/catalog/robux-packages
GET /api/v1/catalog/payment-methods
GET /api/v1/articles
GET /api/v1/articles/{slug}

Endpoint dengan token

Endpoint berikut wajib memakai User API Token:
POST /api/v1/auth/token/validate
GET  /api/v1/me
GET  /api/v1/me/dashboard-summary
GET  /api/v1/me/balance
GET  /api/v1/me/balance/transactions
GET  /api/v1/me/deposits
GET  /api/v1/me/deposits/{invoice}
POST /api/v1/me/orders
GET  /api/v1/me/orders
GET  /api/v1/me/orders/{invoice}
GET  /api/v1/me/invoices/{invoice}
GET  /api/v1/me/invoices/{invoice}/status

Keamanan token

User API Token adalah akses pribadi ke data akun kamu sendiri. Jangan bagikan token ke orang lain.
Jangan simpan token di:
  • HTML publik
  • JavaScript frontend
  • Repository GitHub publik
  • URL query seperti ?token=...
  • Screenshot publik
  • Chat publik
Simpan token di:
  • File .env backend
  • Server bot
  • Secret manager
  • Environment variable hosting

Pola yang benar

User membuka website/bot

Backend/server kamu membaca token dari ENV

Backend/server request ke LeuwongRR API

Response aman dikirim ke user

Pola yang salah

Frontend browser
        ↓ token terlihat di DevTools
LeuwongRR User API

Jika token bocor

Jika token dicurigai bocor:
  1. Login ke akun LeuwongRR
  2. Buka https://leuwongrr.online/user/api-access
  3. Revoke atau regenerate token
  4. Update token baru di backend/server/bot kamu