Erori & Răspunsuri

Ghid de integrare aplicație mobilă

Coduri de stare HTTP

200OK - cerere reușită.
204No Content - returned for OPTIONS preflight requests (CORS).
400Bad Request - parametru lipsă sau invalid.
401Unauthorized - token lipsă sau invalid.
404Not Found - endpoint sau resursă inexistentă.
405Method Not Allowed - metodă HTTP incorectă pentru acest endpoint.

Schema răspuns de succes

JSON
{
  "success": true,
  "...": "endpoint-specific fields"
}

Schema răspuns de eroare

JSON
{
  "success": false,
  "message": "Human-readable error description"
}

CORS

All API responses include the following headers, so the API can be called from web clients:

HTTP
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type, X-API-Token
*
Browsers send a preflight OPTIONS request before a cross-origin POST. The API responds with 204 No Content and the CORS headers above - no body required.