Understanding the API response envelope
Every response has {successful, message, data} — and failures don't always mean a non-200 status.
Every PTERI API response, success or failure, is wrapped the same way:
{
"successful": true,
"message": "...",
"data": { ... }
}
The important part for error handling: a failed request can still return HTTP 200 with successful: false and an explanatory message. If your code only checks the HTTP status code, you can miss real failures. Always check successful first, and surface message in your own error handling.
