Bangkah Launcher

Dokumentasi / API Documentation

API Documentation

Dokumentasi endpoint default yang biasa digunakan setelah scaffold API.

Health Endpoint

curl -X GET http://localhost/api/health -H "Accept: application/json"

Contoh response:

{
  "status": "ok",
  "message": "API is running",
  "app": "MyApp",
  "environment": "local",
  "laravel": "12.42.0",
  "php": "8.4.1",
  "time": "2025-12-15T10:30:00.000000Z"
}

Format Response

Success:

{
  "success": true,
  "data": {},
  "message": "Request berhasil"
}

Error:

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Input tidak valid"
  }
}

HTTP Status Umum

Rate Limiting

Contoh penerapan throttling route:

Route::middleware('throttle:60,1')->group(function () {
    Route::get('/health', [HealthController::class, 'index']);
});

Bearer Token

Untuk endpoint terlindungi, gunakan header berikut:

curl -X GET http://localhost/api/me \
  -H "Authorization: Bearer <token>" \
  -H "Accept: application/json"

On This Page