Erros e Respostas
Guia de Integração do Aplicativo Móvel
Códigos de Status HTTP
| 200 | OK - requisição bem-sucedida. |
| 204 | No Content - returned for OPTIONS preflight requests (CORS). |
| 400 | Bad Request - parâmetro ausente ou inválido. |
| 401 | Unauthorized - token ausente ou inválido. |
| 404 | Not Found - o endpoint ou recurso não existe. |
| 405 | Method Not Allowed - método HTTP incorreto para este endpoint. |
Esquema de Resposta de Sucesso
JSON
{
"success": true,
"...": "endpoint-specific fields"
}
Esquema de Resposta de Erro
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.