Skip to main content

API Styleguide

Panduan untuk design API yang konsisten dan RESTful.

🎯 REST Principles

HTTP Methods

  • GET: Retrieve data
  • POST: Create new resource
  • PUT: Update entire resource
  • PATCH: Partial update
  • DELETE: Remove resource

Status Codes

  • 200 OK: Success
  • 201 Created: Resource created
  • 400 Bad Request: Validation error
  • 401 Unauthorized: Authentication required
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Resource not found
  • 500 Internal Server Error: Server error

📝 Response Format

Success Response

Error Response

🔐 Authentication

API Spec Template

Complete API documentation

Error Handling

Error handling patterns