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
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:
- Login ke akun LeuwongRR
- Buka
https://leuwongrr.online/user/api-access
- Revoke atau regenerate token
- Update token baru di backend/server/bot kamu