# Roles

> `GET /api/academy/roles`: Academy endpoint of the Rone Arena API.

List all hero roles available in the game (Tank, Fighter, Assassin, Mage, Marksman, Support). Supports query parameters for pagination, sorting, and localization.

Query parameters:
- **size**: Number of items per page (minimum: 1).
- **index**: Page index (starting from 1).
- **order**: Sort order for results. Allowed values: `asc`, `desc`.
- **lang**: Language code for localized content (default: `en`).

The response includes role data:
- **records**: Array of role entries, each containing:
    - **_id**: Unique record identifier.
    - **caption**: Localized role caption (e.g., '坦克', '法师').
    - **configId**: Configuration ID.
    - **createdAt**: Creation timestamp.
    - **createdUser**: Creator username.
    - **updatedAt**: Last update timestamp.
    - **updatedUser**: Last updater username.
    - **data**:
        - **emblem_id**: Emblem ID associated with the role.
        - **emblem_title**: Emblem title (e.g., 'Tank', 'Mage').
        - **emblem_icon**: Emblem icon URL.
        - **emblem_detail**:
            - **_id**: Emblem detail record ID.
            - **_createdAt**: Creation timestamp.
            - **_updatedAt**: Last update timestamp.
            - **data**:
                - **emblemid**: Emblem ID.
                - **emblemname**: Emblem name (e.g., 'Assassin').
                - **emblemattrid**: Attribute ID.
                - **emblemattr**: Attribute bonuses (e.g., '+500 Extra Max HP').
                - **attriicon**: Attribute icon URL.
                - **attriicon2**: Secondary attribute icon URL (optional).
                - **emblembg**: Background indicator.

This endpoint is useful for:
- Displaying role categories.
- Explaining role-specific attributes and emblem bonuses.
- Guiding players in hero selection based on roles.

## Request

`GET https://arena.rone.dev/api/academy/roles`

### Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `size` | query | integer | no | `20` | Number of items per page. Range: 1... |
| `index` | query | integer | no | `1` | Page index for pagination. Range: 1... |
| `order` | query | string | no | `asc` | Sort order by emblem_id. One of: `asc`, `desc`. |
| `lang` | query | string | no | `en` | Language code for localized content. One of: `en`, `id`, `ru`, `es`, `pt`, `tr`, `ar`, `de`, `fr`, `it`, `ja`, `ko`, `th`, `vi`, `zh-CN`, `zh-TW`, `km`. |

### Example

```bash
curl -X GET 'https://arena.rone.dev/api/academy/roles'
```

## Example response

```json
{
  "code": 0,
  "message": "OK",
  "data": {
    "records": [
      {
        "_id": "6698bd01613093b976b4a90b",
        "caption": "\u901a\u7528",
        "configId": 144237,
        "createdAt": 1721285889064,
        "createdUser": "nickjin",
        "data": {
          "_object": 2740627,
          "emblem_detail": {
            "_createdAt": 1723097697235,
            "_id": "66b46261f25dc3aacf517fa1",
            "_updatedAt": 1727436297890,
            "data": {
              "attriicon": "https://wsrv.nl/?url=https%3A%2F%2Fakmweb.youngjoygame.com%2Fweb%2Fsvnres%2Fimg%2Fmlbb%2Fhomepage%2F100_4e0cd7364830b178279479bff1146e5e.png",
              "attriicon2": "",
              "emblemattr": {
                "emblemattr": "+12 HP Regen\n+12 Mana Regen\n+275 Extra Max HP\n+22 Adaptive Attack\n",
                "emblemattrid": "2000160",
                "emblemname": "All"
              },
              "emblembg": 0,
              "emblemid": 20001,
              "emblemname": "All"
            },
            "id": 100050,
            "sourceId": 2718120
          },
          "emblem_icon": "https://wsrv.nl/?url=https%3A%2F%2Fakmweb.youngjoygame.com%2Fweb%2Fgms%2Fimage%2Fcf9a85ddcdc9d53f3a1b76f8d8965d53.svg",
          "emblem_id": 20001,
          "emblem_title": "All"
        },
        "id": 2740640,
        "linkId": [
          2740627
        ],
        "sort": 0,
        "updatedAt": 1721287925214,
        "updatedUser": "nickjin"
      }
    ],
    "total": 7
  }
}
```

## Links

- Try it in the playground: https://arena.rone.dev/web/academy/roles
- Academy endpoints: https://arena.rone.dev/web/academy.md
- OpenAPI schema: https://arena.rone.dev/api/openapi.json
