# User Friends

> `GET /api/user/friends`: User endpoint of the Rone Arena API.

**Deprecated:** still answers, but will not receive further work. Prefer another endpoint.

**Sign-in required:** send `Authorization: Bearer <jwt>`. Get the JWT from `POST /api/user/auth/send-vc` then `POST /api/user/auth/login`.

Retrieve the authenticated player's friends information using a valid JWT. Supports query parameters for season filtering and localization. Requires an Authorization header with the JWT from login.

Headers:
- **Authorization**: `Bearer <jwt>` (JWT obtained during login).

Query parameters:
- **sid**: Season ID for filtering friends (must be a valid season ID from `/api/user/season`).
- **lang**: Language code for localized content (default: `en`).

The response includes friend statistics and metadata:
- **bfs**: Best Friends (highlighted or prioritized friends list, may be null).
- **wfs**: Weekly Friends (friends interacted with recently, may be empty).
- **fs**: Friends list entries, each containing:
    - **f**: Friend object with identifiers:
        - **rid**: Role ID (unique player identifier).
        - **zid**: Zone ID (server region).
        - **n**: Name (may be empty if private).
        - **ax**: Avatar URL (may be empty).
        - **pri**: Privacy flag (true if details are hidden).
    - **frid**: Friend Role ID (unique identifier for the friend).
    - **fzid**: Friend Zone ID (server region for the friend).
    - **cl**: Current Level of the friend.
    - **l**: Level (same as cl, sometimes duplicated).
    - **tbc**: Total Battle Count (matches played together).
    - **twc**: Total Win Count (matches won together).

This endpoint is useful for:
- Displaying a player's friend list.
- Tracking shared match history.
- Analyzing cooperative performance with friends across different seasons.

## Request

`GET https://arena.rone.dev/api/user/friends`

### Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `sid` | query | integer | yes |  | The season ID for filtering friends. |
| `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/user/friends?sid=<sid>' \
  -H 'Authorization: Bearer <jwt>'
```

## Example response

```json
{
  "code": 0,
  "message": "Success",
  "traceID": "e0516a11c845c6ca93a1a43178c2f510",
  "data": {
    "wfs": [],
    "fs": [
      {
        "f": {
          "rid": 0,
          "zid": 0,
          "n": "",
          "ax": "",
          "pri": true
        },
        "frid": 0,
        "fzid": 0,
        "cl": 42,
        "l": 42,
        "tbc": 7,
        "twc": 6
      }
    ]
  }
}
```

## Links

- Try it in the playground: https://arena.rone.dev/web/user/friends
- User endpoints: https://arena.rone.dev/web/user.md
- OpenAPI schema: https://arena.rone.dev/api/openapi.json
