API specification
RAID uses Swagger to implement the OpenAPI Specification.
Table of contents
Swagger UI
Perform the following steps to view the API via the Swagger UI:
- Run the application locally by following the Install and run quickstart.
- Go to http://localhost:8080/swagger-ui/index.html.
Run examples
The Swagger specification includes examples that can be run within the Swagger UI:
- Click on an API endpoint to expand it.
- Click Try it out.
- Click Execute to run the prepopulated example.
- Scroll down to view the response.
Error codes
The Swagger specification includes the following error information:
-
The structure of the JSON error response, which is standardized across all endpoints
-
An example HTTP 400 response for each endpoint, where applicable due to the presence of input data
-
An example HTTP 500 response for each endpoint
See the table below for a full list of possible errors:
| RAID error code | HTTP status code | Error message example | Zoo Chatbot | Handwriting recogniser |
|---|---|---|---|---|
| 001_MISSING_FIELD | 400 Bad Request | Field ‘message’ is required | ||
| 002_EMPTY_ARRAY | 400 Bad Request | Array ‘tokens’ must be populated | ||
| 003_MISSING_IMAGE_FILE | 500 Internal Server Error | Image file ‘10.png’ not found. Check the src/main/resources folder | ||
| 100_UNKNOWN_ERROR | 500 Internal Server Error | Cannot invoke “String.toString()” because “response” is null. See log for details |