---
# System prepended metadata

title: D0RS REST API reference

---

# D0RS REST API reference

## Methods

1. `GET` `/getClasses`
    * __Description:__
        Returns classes in array
    * __Output parameters:__
        ```json
        {
            code: int,
            classes: [
                {
                    name: string,
                    id: int
                }
            ]
        }
        ```
    * __Example:__
        ```bash
        curl -X GET ...
        ```

1. `POST` `/predict`
    * __Description:__
        Predicts present classes by survey
    * __Input parameters:__
        ```json
        {
            name: string,
            ...
        }
        ```
    * __Output parameters:__
        ```json
        {
            code: int,
            class: int
        } 
        ```
    * __Example:__
        ```bash
        curl -X POST ...
        ```

___

## Response error
```json
{
    code: int,
    msg: string
} (with status code 4** or 5**)
```

___
## Response codes
 - `0` - OK
 - `1` - auth error
 - `2` - malformed data
 - `3` - internal error