Error Handling
When an error occurs, APS typically provides additional information about what went wrong in the response body. The structure of the response body depends on whether the error was generated by the Application service or the Authentication service. Check the Application Management API Errors and Authentication Errors sections below to learn about the error response structure for each service.
Application Management API Errors
The Application Management API returns standard HTTP status response codes along with an object which contains the title, detail, and logref (trace ID) of the error. Typical body structure
of the error response for Application Management API errors is as follows:
| title string | A summary of the error, suitable for use as a title. |
| detail string | A short, human readable explanation of the error. |
| errors array: object | An array of objects, where each element contains an object that represents an error. |
| field string | An attribute of the request that caused the error. This is the field name of the request parameter that caused the error. |
| title string | A summary of the error, suitable for use as a title. |
| detail string | A short, human readable explanation of the error. |
| logref string | A unique identifier for the error, useful for support purposes. |
Example
{
"title": "NotFound",
"detail": "The requested resource was not found."
"logref": "a1b2c3d4e5f6g7h8i9j0"
}
For validation errors, the error object will contain a errors array of objects. Within each object, there will be a field name, error title, and error detail.
Below is an example from the GET Client Usage Daily Totals endpoint:
{
"title": "ValidationError",
"detail": "The given data was invalid.",
"errors": [
{
"field": "date",
"title": "invalid parameter",
"detail": "The provided date range should be in the format YYYY-MM-DD..YYYY-MM-DD"
}
],
"logref": "a1b2c3d4e5f6g7h8i9j0"
}
Authentication Errors
Authentication errors are typically indicated by a 4xx HTTP status code in the response header. The response body provides details of the error that occurred. The error response structure for Authentication errors and list of Authentication Error Codes can be found in the Authentication API documentation here.