RCSZilla Version 1.0


Erreurs & Réponses

Guide d'intégration application mobile

Codes de statut HTTP

200OK - requête réussie.
204No Content - returned for OPTIONS preflight requests (CORS).
400Bad Request - paramètre manquant ou invalide.
401Unauthorized - token manquant ou invalide.
404Not Found - endpoint ou ressource inexistant.
405Method Not Allowed - mauvaise méthode HTTP pour cet endpoint.

Schéma de réponse succès

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

Schéma de réponse erreur

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.