API specification

RAID uses Swagger to implement the OpenAPI Specification.

Table of contents

  1. Swagger UI
    1. Run examples
  2. Error codes

Swagger UI

Perform the following steps to view the API via the Swagger UI:

  1. Run the application locally by following the Install and run quickstart.
  2. Go to http://localhost:8080/swagger-ui/index.html.

Run examples

The Swagger specification includes examples that can be run within the Swagger UI:

  1. Click on an API endpoint to expand it.
  2. Click Try it out.
  3. Click Execute to run the prepopulated example.
  4. 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 Green tick Green tick
002_EMPTY_ARRAY 400 Bad Request Array ‘tokens’ must be populated Green tick Red cross
003_MISSING_IMAGE_FILE 500 Internal Server Error Image file ‘10.png’ not found. Check the src/main/resources folder Red cross Green tick
100_UNKNOWN_ERROR 500 Internal Server Error Cannot invoke “String.toString()” because “response” is null. See log for details Green tick Green tick