---
# System prepended metadata

title: Fantasy new Leaderbroad API (For Frontend)

---

# Fantasy new Leaderbroad API (For Frontend)

## Game Mechanic
### `GET api/v2/gameMechanic/overallteam` 
- ข้อมูลจำนวนทีมของแต่ละชนิด
- ![](https://i.imgur.com/mMM636F.jpg)

**Request**

| Parameter    | Description | Schema |
| ------------ | ----------- | ------ |
| Season      |             | number |
| Week      |             | number |

**Response**

| Parameter    | Description | Schema |
| ------------ | ----------- | ------ |
| pageket      |             | number |
| pageketName  |             | string |
| count        |             | number |

#### Example Response
```json
{
    "data": [
        {
          "pageket": 0,
          "pageketName": "pageketName001",
          "count": 55
        },
        {
          "pageket": 1,
          "pageketName": "pageketName002",
          "count": 12
        }
  ]
  "status": 0,
  "message": "string"
}

```
### `GET api/v2/gameMechanic/getBanner` 

#### Example Response
```json
{
    "data": [
    "https://ksn-fantasy.cleverse.com/api/profile/user-image?ImageToken=YmFubmVyL2ZhbnRhc3lfMy5qcGc=",
    "https://ksn-fantasy.cleverse.com/api/profile/user-image?ImageToken=YmFubmVyL2ZhbnRhc3lfMi5qcGc=",
    "https://ksn-fantasy.cleverse.com/api/profile/user-image?ImageToken=YmFubmVyL2ZhbnRhc3lfMS5qcGc="
  ],
  "status": 0,
  "message": "string"
}

```

### `GET api/v2/gameMechanic/my-teams` 

- ดึงรายชื่อ fantasy teams ของตัวเอง (ส่ง options เพิ่มใน params)
- ![](https://i.imgur.com/Ml8if88.jpg)


**Header parameter**

| Parameter                                   | Description                      | Schema |
| ------------------------------------------- | -------------------------------- | ------ |
| Authorization <br/><small>(required)</small>     | user token     | string |

**Query parameter**

| Parameter                               | Description  | Schema |
| --------------------------------------- | ------------ | -------|
| userId <br/><small>(required)</small>   |              | string |
| gameweek <br/><small>(required)</small> |              | number |
| season <br/><small>(required)</small>   |              | number |

**Response**

| Parameter      | Description | Schema  |
| -------------- | ----------- | ------  |
| teamId         |             | string  |
| teamName       |             | string  |
| teamImage      |             | string  |
| weekRank       |             | number  |
| seasonRank     |             | number  |
| gameWeekScore  |             | number  |
| seasonScore    |             | number  |
| type           |             | premier_league_free \| premier_league_pay  |
| name           |             | string  |
| formation      |             | string  |
| isConfirm      |             | boolean |
| isOverDeadline |             | boolean |

#### Example Request
```json
{
    "userId": "83fa4d0a-5d4a-4b3b-8864-71a3d18532f2",
    "gameweek": "1",
    "season": "2020"
}
```

#### Example Response
```json
{
    "code": 200,
    "message":null,
    "data": [
      {
        "teamId": "string",
        "teamName": "string",
        "teamImage": "string",
        "weekRank": 0,
        "seasonRank": 0,
        "gameWeekScore": 0,
        "seasonScore": 0,
        "type": "string",
        "name": "string",      
        "isConfirm": true,
        "isOverDeadline": true,
      }
    ]
}
```
## Leaderboard
### `GET api/v2/leaderboard/:Type`
- ดึงข้อมูลตาราง Leaderboard (ส่ง options เพิ่มใน params)
- ![](https://i.imgur.com/EAmZm53.jpg)

 **Static parameter**

| Parameter                             | Description    | Schema              |
| ------------------------------------- | -------------- | ------------------- |
| Type <br/><small>(required)</small> |                |  premier_league_free \| premier_league_pay |

**Query parameter**

| Parameter          | Description      | Schema |
| -----------------  | ---------------- | ------ |
| Season             |                  | number |
| GameWeek           |                  | number |
| Skip               |                  | number |
| Take               |                  | number |

**Response**

| Parameter   | Description | Schema |
| ----------- | ----------- | ------ |
| teamId      |             | string |
| teamImage   |             | string |
| weekRank    |             | number |
| seansonRank |             | number |
| weekScore   |             | number |
| seasonScore |             | number |
| name        |             | string |
| teamName    |             | string |
| bonus       |             | number |


#### Example Request
```json
{
    "Method": "premier_league_free",
    "Season": 2019,
    "GameWeek": 39,
    "Skip": 0,
    "Take": 0,
}
```

#### Example Response
```json
{
  "data": [
    {
      "teamId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "teamImage": "string", 

      "weekRank": 0,
      "seansonRank": 0,
      "weekScore": 0,
      "seasonScore": 0,
      "name": "string", 
      "teamName": "string", 
      "bonus": 0
    }
  ],
  "status": 0,
  "message": "string"
}
```

### `GET api/v2/leaderboard/my-team/:Type/:UserId`

- ดึงข้อมูลตาราง Leaderboard ของทีม
- ![](https://i.imgur.com/A80QHGq.png)


**Static parameter**

| Parameter                             | Description    | Schema              |
| ------------------------------------- | -------------- | ------------------- |
| Type <br/><small>(required)</small> |                |  premier_league_free \| premier_league_pay |
| UserId <br/><small>(required)</small> |                |   string            |


**Query parameter**

| Parameter          | Description      | Schema |
| -----------------  | ---------------- | ------ |
| Season             |                  | number |
| GameWeek           |                  | number |


**Response**

| Parameter   | Description | Schema |
| ----------- | ----------- | ------ |
| teamId      |             | string |
| teamImage   |             | string |
| weekRank    |             | number |
| seansonRank |             | number |
| weekScore   |             | number |
| seasonScore |             | number |
| name        |             | string |
| teamName    |             | string |
| bonus       |             | number |


#### Example Request
```json
{
    "Method": "premier_league_free",    
    "UserId": "c57b7b99-2fc7-450f-bfd5-ddb7f5960c7e",
    "Season": 2019,
    "GameWeek": 39,
}
```

#### Example Response
```json
{
  "data": [
    {
      "teamId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "teamImage": "string", 
      "weekRank": 0,
      "seansonRank": 0,
      "weekScore": 0,
      "seasonScore": 0,
      "name": "string", 
      "teamName": "string",
      "bonus": 0
    }
  ],
  "status": 0,
  "message": "string"
}
```

### `GET api/v2/leaderboard/my-team/:teamId`

- รายละเอียดคะแนนของทีมนั้นๆทีเข้าจากหน้าทีม
![](https://i.imgur.com/mlZYFOU.png)


**Static parameter**

| Parameter                             | Description    | Schema              |
| ------------------------------------- | -------------- | ------------------- |
| TeamId <br/><small>(required)</small> |                |   string            |


**Response**

| Parameter   | Description | Schema |
| ----------- | ----------- | ------ |
| teamId      |             | string |
| teamImage   |             | string |
| weekRank    |             | number |
| seansonRank |             | number |
| weekScore   |             | number |
| seasonScore |             | number |
| name        |             | string |
| teamName    |             | string |
| bonus       |             | number |


#### Example Request
```json
{
    "Method": "premier_league_free",    
    "UserId": "c57b7b99-2fc7-450f-bfd5-ddb7f5960c7e",
    "Season": 2019,
    "GameWeek": 39,
}
```

#### Example Response
```json
{
  "data": [
    {
      "teamId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "teamImage": "string", 
      "weekRank": 0,
      "seansonRank": 0,
      "weekScore": 0,
      "seasonScore": 0,
      "name": "string", 
      "teamName": "string",
      "bonus": 0
    }
  ],
  "status": 0,
  "message": "string"
}
```

## Package
#### Base URL
`Staging: https://ksn-package-management.cleverse.com/`
`Production: https://ksn-package-management.fantasy.gg/`
### `GET /api/package/list`
- ดึงข้อมูล package ในระบบ


**Response**

| Parameter   | Description | Schema |
| ----------- | ----------- | ------ |
| type        |             | number |
| packageName   |             | string |
| packageDescription    |             | string |
| price |             | number |
| discount   |             | number |
| tyleAlias |             | premier_league_free \| premier_league_pay |

#### Example Response
```json
{
  "data": [
    {
      "type": 10,
      "packageName": "string",
      "packageDescription": "string",
      "price": 99.00,
      "discount": 0.00,
      "typeAlias": "premier_league_pay"
    }
  ],
  "status": 0,
  "message": "string"
}