# KSNGG Core API Reference
## Customer
### Add a customer
##### `POST /customers`
**Auth required :** No
#### Example Request
```json
{
"disabled": false,
"name": "Kaotom Musk",
"authMethod": "USER_PASSWORD",
"bankCode": "KBANK",
"bankAccountNo": "12312312312",
"username": "Musk@12345",
"password": "P@ssw0rd@12345",
"email": "mmm@customer.com",
"telNo": "0822222222"
}
```
#### Example Response
```json
{
"id": 2,
"uuid": "7e3700ee-34f3-4d32-855c-04ee6d24f24a",
"name": "Kaotom Musk",
"authMethod": "USER_PASSWORD",
"email": "mmm@customer.com",
"telNo": "0822222222",
"createdAt": "2021-04-12T14:57:31.796Z",
"updatedAt": "2021-04-12T14:57:31.796Z"
}
```
***
### Login customer
##### `POST customers/login`
**Auth required :** No
#### Example Request
```json
{
"username": "test_customer",
"password": "Password@12345",
"rememberMe": false
}
```
#### Example Response
```json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ0ZXN0X2N1c3RvbWVyIiwidG9rZW5WZXJzaW9uIjoiMSIsInJvbGUiOiJVU0VSIiwicmVtZW1iZXJNZSI6ZmFsc2UsImltcGVyc29uYXRlIjpmYWxzZSwiaWF0IjoxNjE3NjE4MTkxLCJleHAiOjE2MTc4NzczOTF9.BrzuPZ2FZEEsJrR7sHMaAdvB8FmrkwfkeOyoPnR_h78"
}
```
***
### Get or search customer list
##### `POST /customers/search`
**Auth required :** Yes
#### Example Request
Search option
- **searchTerm**: Searching customers by username
Sort option
- **sort**: {
**orderBy**: any Customer field (default id)
**sortBy**: "ASC" or "DESC"
}
```json
{
"rowPerPage": 2,
"page": 1,
"sort": {
"orderBy": "id",
"sortBy": "ASC"
}
}
```
#### Example Response
```json
{
"result": [
{
"id": 1,
"uuid": "a8649dfa-efda-4171-b2ff-71366e3a7cee",
"name": "init_cust",
"authMethod": "USER_PASSWORD",
"email": "cust_z@mail.com",
"telNo": "0892211674",
"createdAt": "2021-04-12T07:45:43.164Z",
"updatedAt": "2021-04-12T07:45:43.164Z"
},
{
"id": 2,
"uuid": "7e3700ee-34f3-4d32-855c-04ee6d24f24a",
"name": "Kaotom Musk",
"authMethod": "USER_PASSWORD",
"email": "mmm@customer.com",
"telNo": "0822222222",
"createdAt": "2021-04-12T14:57:31.796Z",
"updatedAt": "2021-04-12T14:57:31.796Z"
}
],
"length": 2,
"totalPage": 1
}
```
***
### Get a customer by id
##### `GET customers/:id`
**Auth required :** Yes
#### Example Request
id=1
#### Example Response
```json
{
"id": 1,
"uuid": "a8649dfa-efda-4171-b2ff-71366e3a7cee",
"name": "init_cust",
"authMethod": "USER_PASSWORD",
"email": "cust_z@mail.com",
"telNo": "0892211674",
"createdAt": "2021-04-12T07:45:43.164Z",
"updatedAt": "2021-04-12T07:45:43.164Z"
}
```
***
### Update customer profile
##### `PATCH /customers/profile`
**Auth required :** Yes
#### Example Request
```json
{
"name": "Astra Zeneca",
"telNo": "0923344667",
"email":"myVaccine@mail.com", // only social login can change email
"image": "https://ksngg-assets.s3.amazonaws.com/profile/11-b064f678-1c9b-439d-b339-ffd7637324bc.png"
}
```
#### Example Response
```json
{
"id": 799138,
"uid": "W5ntbg8PnyLgzwobRzPj47QGrdO2",
"name": "Astra Zeneca",
"authMethod": "GMAIL",
"jwtVersion": "1",
"email": "myvaccine@mail.com",
"telNo": "0923344667",
"tickets": {},
"accessGuru": true,
"image": "https://ksngg-assets.s3.amazonaws.com/profile/11-b064f678-1c9b-439d-b339-ffd7637324bc.png",
"createdAt": "2021-06-04T04:07:43.786Z",
"updatedAt": "2021-06-15T03:48:16.273Z"
}
```
***
### Add/Update Customer Bank Account
##### `PATCH /customers/bank-account`
**Auth required :** Yes
#### Example Request
```json
{
"bankAccountName": "Test Guy",
"bankCode": "GSB",
"bankAccountNo": "024456873123"
}
```
#### Example Response
```json
{
"customerId": 33,
"name": null,
"bankAccountName": "Test Guy",
"bankCode": "GSB",
"accountNo": "024456873123",
"image": null
}
```
***
### Get Customer Bank Account
##### `Get /customers/bank-account/detail`
**Auth required :** Yes
#### Example Request
```json
{
no request body
}
```
#### Example Response
```json
{
"customerId": 33,
"name": null,
"bankCode": "GSB",
"accountNo": "024456873123",
"image": null
}
```
***
### Deactivate Customer Bank Account
##### `PATCH /customers/bank-account/deactivate`
**Auth required :** Yes
#### Example Request
```json
{
No request body
}
```
#### Example Response
```json
{
"customerId": 33,
"name": null,
"bankCode": null,
"accountNo": null,
"image": null
}
```
***
## Club
### Get club detail by id
##### `GET /clubs/:id`
**Auth required :** Yes
#### Example Request
id=2
#### Example Response
```json
{
"id": 2,
"disabled": false,
"spId": "12",
"name": "Manchester United",
"abbr": "MUN",
"league": "PL",
"clubType": "Club",
"nationCode": "Thailand",
"imgThumbnail": "Smallimg.jpeg",
"img": "Smallimg.jpeg",
"createdAt": "2021-04-08T03:19:53.191Z",
"updatedAt": "2021-04-08T03:26:01.545Z"
}
```
***
### Get or search clubs
##### `POST /club/search`
**Auth required :** Yes
#### Example Request
```json
{
"rowPerPage": 2,
"page": 1,
"sort": {
"orderBy": "id",
"sortBy": "ASC"
},
"type":"Club",
"league":"PL",
"searchTerm":""
}
```
**Note**: searchTerm, type, league and sort object are an optional
#### Example Response
```json
{
"result": [
{
"id": 1,
"disabled": false,
"spId": "12",
"name": "Liverpool",
"abbr": "MUN",
"league": "PL",
"clubType": "Club",
"nationCode": "Thailand",
"imgThumbnail": "Smallimg.jpeg",
"img": "Smallimg.jpeg",
"createdAt": "2021-04-09T10:11:04.772Z",
"updatedAt": "2021-04-09T15:17:51.675Z"
},
{
"id": 2,
"disabled": false,
"spId": "12",
"name": "Manchester United",
"abbr": "MUN",
"league": "PL",
"clubType": "Club",
"nationCode": "United_Kingdom",
"imgThumbnail": "Smallimg.jpeg",
"img": "Smallimg.jpeg",
"createdAt": "2021-04-09T15:15:17.313Z",
"updatedAt": "2021-04-09T15:16:06.130Z"
}
],
"length": 2,
"totalPage": 1
}
```
***
## Footballer
### Get or search footballers
##### `POST /footballers/search`
**Auth required :** Yes
#### Example Request
```json
{
"page": 1,
"rowPerPage":5,
"isGetAll": false,
"searchTerm": "",
"position": "MF",
"isSuspended": false,
"sort": {
"orderBy": "id",
"sortBy": "ASC"
}
}
```
##### ** isGetAll is a flag for getting all footballers **
##### ** all string values are case-insensitive **
#### Example Response
```json
{
"result": [
{
"id": 1,
"disabled": false,
"clubId": 1,
"nationCode": "Egypt",
"isSuspended": false,
"warning": "",
"spId": "22,44,54",
"name": "Mohammed Salah",
"abbr": "Salah",
"shirtNo": 11,
"position": "MF",
"performance": 8,
"picSmall": "salah_big.jpeg",
"picBig": "salah_small.jpeg",
"createdAt": "2021-04-08T19:04:02.284Z",
"updatedAt": "2021-04-08T19:04:02.284Z"
},
{
"id": 2,
"disabled": false,
"clubId": 2,
"nationCode": "Belgium",
"isSuspended": false,
"warning": "",
"spId": "5,25,87",
"name": "Kevin De Bruyne",
"abbr": "KDB",
"shirtNo": 17,
"position": "MF",
"performance": 9,
"picSmall": "kdb_big.jpeg",
"picBig": "kdb_small.jpeg",
"createdAt": "2021-04-08T19:04:02.284Z",
"updatedAt": "2021-04-08T19:04:02.284Z"
}
],
"length": 2,
"totalPage": 1
}
```
***
### Get footballer detail by id
##### `GET /footballers/b/:id`
**Auth required :** Yes
#### Example Request
id=1
#### Example Response
```json
{
"id": 1,
"disabled": false,
"clubId": 1,
"nationCode": "Egypt",
"isSuspended": false,
"warning": "",
"spId": "s,liv,11",
"name": "Mohammed Salah",
"abbr": "Salah",
"shirtNo": 11,
"position": "MF",
"performance": 8,
"picSmall": "salah_big.jpeg",
"picBig": "salah_small.jpeg",
"createdAt": "2021-04-06T15:01:31.167Z",
"updatedAt": "2021-04-06T15:01:31.167Z"
}
```
***
### Get footballer matches by id
##### `POST /footballers/:id/list-match`
**Auth required :** Yes
#### Example Request
```json
{
}
```
#### Example Response
```json
{
}
```
### Get footballers by batch id
##### `GET /footballers/:batchId`
**Auth required :** Yes
#### Example Request
batchId = 2
#### Example Response
```json
[
{
"id": 6744,
"name": "Lee Grant",
"abbr": "Lee Grant",
"cost": "999999.00",
"jerseyNum": 13,
"nationCode": "England",
"point": 0,
"position": "Goalkeeper",
"warning": "",
"clubname": "Manchester United",
"clubabbr": "MUN",
"isSuspended": false,
"chosenPercentage": 0,
"batchId": 2
},
{
"id": 7645,
"name": "Phil Jagielka",
"abbr": "Phil Jagielka",
"cost": "999999.00",
"jersey_num": 15,
"nation_code": "England",
"point": 0,
"position": "Defender",
"warning": "",
"clubname": "Sheffield United",
"clubabbr": "SHU",
"isSuspended": false,
"chosenPercentage": 0,
"batchId": 2
},
{
"id": 11974,
"name": "Eldin Jakupovic",
"abbr": "Eldin Jakupovic",
"cost": "999999.00",
"jersey_num": 35,
"nation_code": "Switzerland",
"point": 0,
"position": "Goalkeeper",
"warning": "",
"clubname": "Leicester City",
"clubabbr": "LEI",
"isSuspended": false,
"chosenPercentage": 0,
"batchId": 2
},
{
"id": 15033,
"name": "Wes Morgan",
"abbr": "Wes Morgan",
"cost": "999999.00",
"jersey_num": 5,
"nation_code": "Jamaica",
"point": 0,
"position": "Defender",
"warning": "",
"clubname": "Leicester City",
"clubabbr": "LEI",
"isSuspended": false,
"chosenPercentage": 0,
"batchId": 2
},
{
"id": 15157,
"name": "James Milner",
"abbr": "James Milner",
"cost": "999999.00",
"jersey_num": 7,
"nation_code": "England",
"point": 0,
"position": "Midfielder",
"warning": "",
"clubname": "Liverpool",
"clubabbr": "LIV",
"isSuspended": false,
"chosenPercentage": 0,
"batchId": 2
}
]
```
### Get footballer detail by id and batch id
##### `GET /footballers/:id/batch/:batchId`
**Auth required :** Yes
#### Example Request
id=6744
batchId = 2
#### Example Response
```json
{
"id": 6744,
"name": "Lee Grant",
"abbr": "Lee Grant",
"cost": "2.00",
"nationCode": "England",
"point": 0,
"position": "Goalkeeper",
"warning": "",
"isSuspended": false,
"jerseyNum": 13,
"chosenPercentage": 0,
"batchId": 2,
"clubName": "Manchester United",
"clubAbbr": "MUN"
}
```
***
## TicketType
### Add a new ticketType
##### `POST /admin/ticket-types`
**Auth required :** Yes
##### ** name value is case-sensitive **
#### Example Request
```json
{
"name": "free",
"price": 0,
"img": "Smallimg.jpeg"
}
```
#### Example Response
```json
{
"id": 2,
"name": "free",
"price": 0,
"img": "Smallimg.jpeg",
"updatedAt": "2021-04-08T03:37:15.783Z",
"createdAt": "2021-04-08T03:37:15.783Z"
}
```
***
### Update a ticketType
##### `PATCH /admin/ticket-types/:id`
**Auth required :** Yes
##### ** name value is case-sensitive **
#### Example Request
id=2
```json
{
"name": "Free",
"price": 99.00,
"img": "Smallimg.jpeg"
}
```
#### Example Response
```json
{
"id": 2,
"name": "Free",
"price": 0,
"img": "Smallimg.jpeg",
"createdAt": "2021-04-08T03:37:15.783Z",
"updatedAt": "2021-04-08T03:42:49.999Z"
}
```
***
### Get ticketType by id
##### `GET /ticket-types/:id`
**Auth required :** Yes
#### Example Request
id=2
#### Example Response
```json
{
"id": 2,
"name": "Free",
"price": 0,
"img": "Smallimg.jpeg",
"createdAt": "2021-04-08T03:37:15.783Z",
"updatedAt": "2021-04-08T03:42:49.999Z"
}
```
***
### Get ticketType list
##### `POST /ticket-types/list`
**Auth required :** Yes
#### Example Request
```json
{
"parentBatchId": 1
}
```
#### Example Response
```json
{
"ticketTypes": [
{
"price": "99",
"id": 3,
"code": "EU20-WEEK",
"description": "ยูโร2020 รายเกมวีค",
"imgThumbnail": "a.jpg",
"free1": false,
"saleStart": "2020-12-31T17:00:00.000Z",
"saleClose": "2021-07-11T18:55:00.000Z",
"createdAt": "2021-03-31T17:00:00.000Z",
"updatedAt": "2021-03-31T17:00:00.000Z"
},
{
"price": "299",
"id": 1,
"code": "EU20-TOUR",
"description": "ยูโร2020 ทัวร์นาเมนท์ (ล่วงหน้า)",
"imgThumbnail": "a.jpg",
"free1": false,
"saleStart": "2020-12-31T17:00:00.000Z",
"saleClose": "2021-06-11T18:55:00.000Z",
"createdAt": "2021-03-31T17:00:00.000Z",
"updatedAt": "2021-03-31T17:00:00.000Z"
}
],
"batchDescription": "ยูโร 2020 วีค 37",
"roundId": 37
}
```
***
## Batch
### Get a Batch by id
##### `GET /batches/:id`
**Auth required :** Yes
#### Example Request
param
id=2
#### Example Response
```json
{
"id": 2,
"batchType": "Normal",
"spCompetitionId": 8,
"spSeasonId": 2020,
"roundId": 1,
"description": "English Premier League Season 2020/2021",
"saleStart": null,
"saleClose": null,
"setupStart": "2021-04-14T16:42:23.000Z",
"setupClose": "2021-04-30T16:42:23.000Z",
"substitutionAllowance": 0,
"status": "ACTIVE",
"scoreRule": {},
"evId": null,
"createdAt": "2021-04-14T16:42:23.000Z",
"updatedAt": "2021-04-14T16:42:23.000Z",
"parentBatchId": 1
}
```
### Get default batch Active
##### `GET /batches/default`
**Auth required :** Yes
**NOTE : batch type: "Tournament" incorrect information
#### Example Response
```json
{
"Season": {
"id": 4,
"batchType": "Season",
"roundId": 3,
"description": "English Premier League Season 2020/2021",
"nextGWStart": "2021-03-31T17:00:00.000Z",
"league": "PL"
},
"Tournament": {
"id": 40,
"batchType": "Tournament",
"roundId": 0,
"description": "Premier League 2020/2021",
"nextGWStart": "2020-10-04T14:33:25.759Z"
},
"Normal": {}
}
```
***
## Match
### Update a Match
##### `PATCH /admin/matches/:id`
**Auth required :** Yes
#### Example Request
id=1
```json
{
"disabled": false,
"spId": "1",
"batchId":1,
"homeClubId": 1,
"awayClubId": 2,
"description": "test update match",
"league": "PL",
"startTime": "2021-04-10T01:33:21.092Z",
"homeScore":3 ,
"awayScore":2,
"rawfeedEnabled": false
}
```
#### Example Response
```json
{
"id": 1,
"disabled": false,
"spId": "1",
"homeClubId": 1,
"awayClubId": 2,
"description": "test update match",
"league": "PL",
"startTime": "2021-04-10T01:33:21.092Z",
"homeScore": 3,
"awayScore": 2,
"rawfeedEnabled": false,
"createdAt": "2021-04-10T09:32:39.765Z",
"updatedAt": "2021-04-10T09:36:32.469Z"
}
```
***
### Get Match by id
##### `GET /matches/:id`
**Auth required :** Yes
#### Example Request
id=1
#### Example Response
```json
{
"id": 1,
"disabled": false,
"spId": "1",
"homeClubId": 1,
"awayClubId": 2,
"description": "test update match",
"league": "PL",
"startTime": "2021-04-10T01:33:21.092Z",
"homeScore": 3,
"awayScore": 2,
"rawfeedEnabled": false,
"createdAt": "2021-04-10T09:32:39.765Z",
"updatedAt": "2021-04-10T09:36:32.469Z"
}
```
***
### Get or search Match
##### `POST /matches/search`
**Auth required :** Yes
#### Example Request
```json
{
"rowPerPage": 2,
"page": 1,
"sort": {
"orderBy": "id",
"sortBy": "DESC"
},
"league":"PL"
}
```
**Note**: league and sort object are an optional
#### Example Response
```json
{
"result": [
{
"id": 1,
"disabled": false,
"spId": "1",
"homeClubId": 1,
"awayClubId": 2,
"description": "test update match",
"league": "PL",
"startTime": "2021-04-10T01:33:21.092Z",
"homeScore": 3,
"awayScore": 2,
"rawfeedEnabled": false,
"createdAt": "2021-04-10T09:32:39.765Z",
"updatedAt": "2021-04-10T09:36:32.469Z"
}
],
"length": 1,
"totalPage": 1
}
```
***
### Get prevMatch and UpcomingMatch
##### `POST /matches/footballer/:footballerId/batch/batchId`
**Auth required :** Yes
#### Example Request
footballerId = 6744
batchId =2
#### Example Response
```json
{
"prevMatch": [
{
"homeClubName": "Burnley",
"awayClubName": "Manchester United",
"homeClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=90",
"awayClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=1",
"homeScore": 0,
"awayScore": 1,
"startTime": "2021-01-12T20:15:00.000Z"
},
{
"homeClubName": "Manchester United",
"awayClubName": "Crystal Palace",
"homeClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=1",
"awayClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=31",
"homeScore": 1,
"awayScore": 3,
"startTime": "2020-09-19T16:30:00.000Z"
}
],
"upcomingMatch": [
{
"homeClubName": "Manchester United",
"awayClubName": "Liverpool",
"homeClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=1",
"awayClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=14",
"homeScore": 0,
"awayScore": 0,
"startTime": "2021-05-01T14:00:00.000Z"
},
{
"matchId": 2128627,
"homeClubName": "Aston Villa",
"awayClubName": "Manchester United",
"homeClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=7",
"awayClubImg": "http://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=1",
"homeScore": 0,
"awayScore": 0,
"startTime": "2021-05-08T14:00:00.000Z"
}
]
}
```
***
## Team
### Create a new Team
##### `POST /teams`
**Auth required :** Yes
#### Example Request
```json
{
"contestId": 2,
"customerId": 2,
"title": "first team",
"imgThumbnail": "Smallimg.jpeg",
"img": "Smallimg.jpeg",
"captainFootballerId":80201,
"inputs":{
"Goalkeeper":[
80201
],
"Defender":[
192895,
462424,
39476,
226597
],
"Midfielder":[
230046,
122806,
40564,
114283
],
"Forward":[
93284,
207025
]
}
}
```
#### Example Response
```json
{
"title": "last created",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"contestId": 2,
"customerId": 1,
"roundId": 1,
"point": 0,
"rank": 0,
"captainFootballerId": 80201,
"initialBudget": 80,
"remainingBudget": "69",
"isSubstitution": false,
"substitutionAllowance": 10,
"footballers": {
"Goalkeeper": [
{
"footballerId": 80201,
"cost": "1",
"position": "Goalkeeper",
"order": 1,
"point": 0,
"isCaptain": true,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 1,
"name": "Bernd Leno",
"abbr": "Bernd Leno",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Defender": [
{
"footballerId": 192895,
"cost": "1",
"position": "Defender",
"order": 2,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 3,
"name": "Kieran Tierney",
"abbr": "Kieran Tierney",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 462424,
"cost": "1",
"position": "Defender",
"order": 3,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 4,
"name": "William Saliba",
"abbr": "William Saliba",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 39476,
"cost": "1",
"position": "Defender",
"order": 4,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 5,
"name": "Sokratis",
"abbr": "Sokratis",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 226597,
"cost": "1",
"position": "Defender",
"order": 5,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 6,
"name": "Gabriel Magalhães",
"abbr": "Gabriel Magalhães",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Midfielder": [
{
"footballerId": 230046,
"cost": "1",
"position": "Midfielder",
"order": 6,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 6,
"name": "Douglas Luiz",
"abbr": "Douglas Luiz",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 122806,
"cost": "1",
"position": "Midfielder",
"order": 7,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 7,
"name": "John McGinn",
"abbr": "John McGinn",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 40564,
"cost": "1",
"position": "Midfielder",
"order": 8,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 8,
"name": "Henri Lansbury",
"abbr": "Henri Lansbury",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 114283,
"cost": "1",
"position": "Midfielder",
"order": 9,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 10,
"name": "Jack Grealish",
"abbr": "Jack Grealish",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
}
],
"Forward": [
{
"footballerId": 93284,
"cost": "1",
"position": "Forward",
"order": 10,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Florin Andone",
"abbr": "Florin Andone",
"teamSnapshotId": 24,
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
},
{
"footballerId": 207025,
"cost": "1",
"position": "Forward",
"order": 11,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Jan Mlakar",
"abbr": "Jan Mlakar",
"teamSnapshotId": 24,
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
}
]
}
}
```
### Get team by id
##### `GET /teams/:id`
**Auth required :** Yes
#### Example Request
id=16
```json
{
"rowPerPage": 10,
"page": 1,
"sort": {
"orderBy": "id",
"sortBy": "ASC"
}
}
```
#### Example Response
```json=
{
"result": [
{
"remainingBalance": "66",
"id": 54,
"roundId": 1,
"point": 0,
"rank": 0,
"captainFootballerId": 80201,
"createdAt": "2021-04-21T02:28:04.047Z",
"updatedAt": "2021-04-21T02:28:04.047Z",
"teamId": 50,
"contestId": 2,
"Team": {
"id": 50,
"title": "first team",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"createdAt": "2021-04-21T02:28:04.034Z",
"updatedAt": "2021-04-21T02:28:04.034Z",
"customerId": 2,
"contestId": 2
}
}
],
"length": 1,
"totalPage": 1
}
```
### Update team by id
##### `PATCH /teams/:id`
**Auth required :** Yes
#### Example Request
id= 16
```json
{
"title": "check update first team",
"imgThumbnail": "Smallimg.jpeg",
"img": "Smallimg.jpeg"
}
```
#### Example Response
```json
{
"id": 50,
"title": "check update first team",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"createdAt": "2021-04-21T02:28:04.034Z",
"updatedAt": "2021-04-21T02:31:59.649Z",
"customerId": 2,
"contestId": 2
}
```
### Get team specific teamSnapshot
##### `POST /teams/:id/snapshots/:roundId`
**Auth required :** Yes
#### Example Request
id= 16
roundId= 1
```json
{
"customerId":5
}
```
#### Example Response
```json
{
"teamId": 35,
"title": "last created",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"contestId": 2,
"contestType": "PAID",
"contestDescription": "",
"batchId": 2,
"batchType": "Normal",
"customerId": 1,
"roundId": 1,
"point": 0,
"rank": 0,
"avgPoint": 230,
"highestPoint": 437,
"captainFootballerId": 80201,
"initialBudget": 80,
"remainingBudget": "69",
"substitutionAllowance": 10,
"footballers": {
"Goalkeeper": [
{
"footballerId": 80201,
"cost": "1",
"position": "Goalkeeper",
"order": 1,
"point": 0,
"isCaptain": true,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 1,
"name": "Bernd Leno",
"abbr": "Bernd Leno",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Defender": [
{
"footballerId": 192895,
"cost": "1",
"position": "Defender",
"order": 2,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 3,
"name": "Kieran Tierney",
"abbr": "Kieran Tierney",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 462424,
"cost": "1",
"position": "Defender",
"order": 3,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 4,
"name": "William Saliba",
"abbr": "William Saliba",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 39476,
"cost": "1",
"position": "Defender",
"order": 4,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 5,
"name": "Sokratis",
"abbr": "Sokratis",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 226597,
"cost": "1",
"position": "Defender",
"order": 5,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 6,
"name": "Gabriel Magalhães",
"abbr": "Gabriel Magalhães",
"teamSnapshotId": 24,
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Midfielder": [
{
"footballerId": 230046,
"cost": "1",
"position": "Midfielder",
"order": 6,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 6,
"name": "Douglas Luiz",
"abbr": "Douglas Luiz",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 122806,
"cost": "1",
"position": "Midfielder",
"order": 7,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 7,
"name": "John McGinn",
"abbr": "John McGinn",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 40564,
"cost": "1",
"position": "Midfielder",
"order": 8,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 8,
"name": "Henri Lansbury",
"abbr": "Henri Lansbury",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 114283,
"cost": "1",
"position": "Midfielder",
"order": 9,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 10,
"name": "Jack Grealish",
"abbr": "Jack Grealish",
"teamSnapshotId": 24,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
}
],
"Forward": [
{
"footballerId": 93284,
"cost": "1",
"position": "Forward",
"order": 10,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Florin Andone",
"abbr": "Florin Andone",
"teamSnapshotId": 24,
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
},
{
"footballerId": 207025,
"cost": "1",
"position": "Forward",
"order": 11,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Jan Mlakar",
"abbr": "Jan Mlakar",
"teamSnapshotId": 24,
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
}
]
}
}
```
### Update team specific teamSnapshot
##### `PATCH /teams/:id/snapshots/:roundId`
**Auth required :** Yes
#### Example Request
id= 16
roundId= 3
```json=
"customerId":5,
"captainFootballerId":80201,
"inputs":{
"Goalkeeper":[
80201
],
"Defender":[
192895,
462424,
39476,
226597
],
"Midfielder":[
230046,
122806,
40564,
114283
],
"Forward":[
93284,
207025
]
}
```
#### Example Response
```json
{
"teamId": 46,
"title": "contest1 team2",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"contestId": 1,
"contestType": "FREE",
"contestDescription": "",
"batchId": 2,
"batchType": "Normal",
"customerId": 1,
"roundId": 2,
"point": 0,
"rank": 0,
"captainFootballerId": 114283,
"initialBudget": 80,
"remainingBalance": "69",
"isSubstitution": true,
"substitutionAllowance": 10,
"footballers": {
"Goalkeeper": [
{
"footballerId": 80201,
"cost": "1",
"position": "Goalkeeper",
"order": 1,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 1,
"name": "Bernd Leno",
"abbr": "Bernd Leno",
"teamSnapshotId": 35,
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Defender": [
{
"footballerId": 192895,
"cost": "1",
"position": "Defender",
"order": 2,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 3,
"name": "Kieran Tierney",
"abbr": "Kieran Tierney",
"teamSnapshotId": 35,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 462424,
"cost": "1",
"position": "Defender",
"order": 3,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 4,
"name": "William Saliba",
"abbr": "William Saliba",
"teamSnapshotId": 35,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 156074,
"cost": "1",
"position": "Defender",
"order": 4,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 16,
"name": "Rob Holding",
"abbr": "Rob Holding",
"teamSnapshotId": 35,
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 69140,
"cost": "1",
"position": "Defender",
"order": 5,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 20,
"name": "Shkodran Mustafi",
"abbr": "Shkodran Mustafi",
"teamSnapshotId": 35,
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Midfielder": [
{
"footballerId": 230046,
"cost": "1",
"position": "Midfielder",
"order": 6,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 6,
"name": "Douglas Luiz",
"abbr": "Douglas Luiz",
"teamSnapshotId": 35,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 122806,
"cost": "1",
"position": "Midfielder",
"order": 7,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 7,
"name": "John McGinn",
"abbr": "John McGinn",
"teamSnapshotId": 35,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 40564,
"cost": "1",
"position": "Midfielder",
"order": 8,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 8,
"name": "Henri Lansbury",
"abbr": "Henri Lansbury",
"teamSnapshotId": 35,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 114283,
"cost": "1",
"position": "Midfielder",
"order": 9,
"point": 0,
"isCaptain": true,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 10,
"name": "Jack Grealish",
"abbr": "Jack Grealish",
"teamSnapshotId": 35,
"clubName": "Aston Villa",
"clubAbbr": "AVL"
}
],
"Forward": [
{
"footballerId": 93284,
"cost": "1",
"position": "Forward",
"order": 10,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Florin Andone",
"abbr": "Florin Andone",
"teamSnapshotId": 35,
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
},
{
"footballerId": 207025,
"cost": "1",
"position": "Forward",
"order": 11,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Jan Mlakar",
"abbr": "Jan Mlakar",
"teamSnapshotId": 35,
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
}
]
}
}
```
### Admin search
##### `POST /admin/teams/search`
**Auth required :** Yes
#### Example Request
```json
{
"rowPerPage": 3,
"page": 1,
"sort": {
"orderBy": "id",
"sortBy": "DESC"
},
"searchTerm":"",
"roundId":1
}
```
#### Example Response
```json
{
"result": [
{
"remainingBalance": "66",
"id": 54,
"roundId": 1,
"point": 0,
"rank": 0,
"captainFootballerId": 80201,
"createdAt": "2021-04-21T02:28:04.047Z",
"updatedAt": "2021-04-21T02:28:04.047Z",
"teamId": 50,
"contestId": 2,
"Team": {
"id": 50,
"title": "check update first team",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"createdAt": "2021-04-21T02:28:04.034Z",
"updatedAt": "2021-04-21T02:31:59.649Z",
"customerId": 2,
"contestId": 2
}
},
{
"remainingBalance": "63.25",
"id": 53,
"roundId": 1,
"point": 0,
"rank": 0,
"captainFootballerId": 114283,
"createdAt": "2021-04-21T02:17:08.663Z",
"updatedAt": "2021-04-21T02:20:48.326Z",
"teamId": 49,
"contestId": 2,
"Team": {
"id": 49,
"title": "first team",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"createdAt": "2021-04-21T02:17:08.653Z",
"updatedAt": "2021-04-21T02:17:08.653Z",
"customerId": 2,
"contestId": 2
}
}
],
"length": 2,
"totalPage": 1
}
```
### Customer list team's customer
##### `POST /teams/list-team`
**Auth required :** Yes
#### Example Request
```json
{
"customerId":5,
"parentBatchId":1
}
```
#### Example Response
```json
{
"remainingTicket": [
{
"code": "PL_WEEK",
"description": "Premier league weekly",
"price": "20",
"amount": 10
}
],
"result": [
{
"id": 1174177,
"title": "cust 5 ",
"imgThumbnail": "Smallimg.jpeg",
"point": 6,
"rank": 27,
"roundId": 2,
"contestType": "PAID"
},
{
"id": 1174178,
"title": "cust 5 test team 2",
"imgThumbnail": "Smallimg.jpeg",
"point": 6,
"rank": 28,
"roundId": 2,
"contestType": "PAID"
},
{
"id": 1174179,
"title": "cust 5 test team 3",
"imgThumbnail": "Smallimg.jpeg",
"point": 6,
"rank": 29,
"roundId": 2,
"contestType": "PAID"
},
{
"id": 1174180,
"title": "cust 5 test team 3",
"imgThumbnail": "Smallimg.jpeg",
"point": 6,
"rank": 44,
"roundId": 2,
"contestType": "FREE"
},
{
"id": 1174181,
"title": "tt test",
"imgThumbnail": "Smallimg.jpeg",
"point": 4,
"rank": 110,
"roundId": 2,
"contestType": "FREE"
},
{
"id": 1174183,
"title": "test contest 9 free ",
"imgThumbnail": "Smallimg.jpeg",
"point": 0,
"rank": 0,
"roundId": 3,
"contestType": "FREE"
},
{
"id": 1174184,
"title": "first team",
"imgThumbnail": "Smallimg.jpeg",
"point": 0,
"rank": 0,
"roundId": 3,
"contestType": "FREE"
},
{
"id": 1174185,
"title": "test test test test",
"imgThumbnail": "Smallimg.jpeg",
"point": 0,
"rank": 0,
"roundId": 3,
"contestType": "FREE"
},
{
"id": 1174186,
"title": "ttttttt",
"imgThumbnail": "Smallimg.jpeg",
"point": 0,
"rank": 0,
"roundId": 3,
"contestType": "FREE"
},
{
"id": 1174182,
"title": "test contest 10 paid ",
"imgThumbnail": "Smallimg.jpeg",
"point": 0,
"rank": 0,
"roundId": 3,
"contestType": "PAID"
}
]
}
```
### Get last team's customer created
##### `POST /teams/last-created`
**Auth required :** Yes
#### Example Request
```json
{
"customerId": 1,
"contestId": 2
}
```
#### Example Response
**Note**: id : teamSnapshot id
* Example get only one last team
```json
[
{
"teamId": 31,
"title": "last created",
"img": "Smallimg.jpeg",
"imgThumbnail": "Smallimg.jpeg",
"contestId": 2,
"customerId": 1,
"roundId": 3,
"point": 0,
"rank": 0,
"captainFootballerId": 80201,
"initialBuget": 80,
"remainingBudget": "69",
"substitutionAllowance": 10,
"footballers": {
"Goalkeeper": [
{
"footballerId": 80201,
"cost": "1",
"position": "Goalkeeper",
"order": 1,
"point": 0,
"isCaptain": true,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 1,
"name": "Bernd Leno",
"abbr": "Bernd Leno",
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Defender": [
{
"footballerId": 192895,
"cost": "1",
"position": "Defender",
"order": 2,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 3,
"name": "Kieran Tierney",
"abbr": "Kieran Tierney",
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 462424,
"cost": "1",
"position": "Defender",
"order": 3,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 4,
"name": "William Saliba",
"abbr": "William Saliba",
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 39476,
"cost": "1",
"position": "Defender",
"order": 4,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 5,
"name": "Sokratis",
"abbr": "Sokratis",
"clubName": "Arsenal",
"clubAbbr": "ARS"
},
{
"footballerId": 226597,
"cost": "1",
"position": "Defender",
"order": 5,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 6,
"name": "Gabriel Magalhães",
"abbr": "Gabriel Magalhães",
"clubName": "Arsenal",
"clubAbbr": "ARS"
}
],
"Midfielder": [
{
"footballerId": 230046,
"cost": "1",
"position": "Midfielder",
"order": 6,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 6,
"name": "Douglas Luiz",
"abbr": "Douglas Luiz",
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 122806,
"cost": "1",
"position": "Midfielder",
"order": 7,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 7,
"name": "John McGinn",
"abbr": "John McGinn",
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 40564,
"cost": "1",
"position": "Midfielder",
"order": 8,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 8,
"name": "Henri Lansbury",
"abbr": "Henri Lansbury",
"clubName": "Aston Villa",
"clubAbbr": "AVL"
},
{
"footballerId": 114283,
"cost": "1",
"position": "Midfielder",
"order": 9,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": 10,
"name": "Jack Grealish",
"abbr": "Jack Grealish",
"clubName": "Aston Villa",
"clubAbbr": "AVL"
}
],
"Forward": [
{
"footballerId": 93284,
"cost": "1",
"position": "Forward",
"order": 10,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Florin Andone",
"abbr": "Florin Andone",
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
},
{
"footballerId": 207025,
"cost": "1",
"position": "Forward",
"order": 11,
"point": 0,
"isCaptain": false,
"isSuspended": false,
"warning": "",
"performance": 0,
"jerseyNum": null,
"name": "Jan Mlakar",
"abbr": "Jan Mlakar",
"clubName": "Brighton and Hove Albion",
"clubAbbr": "BHA"
}
]
}
}
]
```
***
## Order
### Create Order
##### `POST /orders`
**Auth required :** Yes
#### Example Request
```json
{
"ticketTypeId": 5,
"orderQty": 2,
"paymentGateway": "ChillPay",
"paymentMethod": "creditcard",
"device": "web"
}
```
#### Example Response
```json
{
"orderNo": 22,
"description": "Premier league weekly",
"orderQty": 2,
"amount": "40",
"status": "PENDING",
"paymentGateway": "ChillPay",
"channelCode": "creditcard",
"createdAt": "2021-05-01T10:39:32.875Z",
"updatedAt": "2021-05-01T10:39:32.875Z"
}
```
***
### Update Order Status
##### `PATCH /admin/orders/:id`
**Auth required :** Yes
#### Example Request
```json
id = 36
{
"status": "FAILED"
}
```
#### Example Response
```json
{
"id": 36,
"orderNo": null,
"orderQty": 1,
"amount": "99",
"description": "premium",
"customerTelno": "0892211674",
"paymentGateway": "ChillPay",
"paymentMethod": "creditcard",
"transactionId": "47659",
"status": "FAILED",
"smilepay": {},
"createdAt": "2021-04-24T09:55:11.002Z",
"updatedAt": "2021-04-28T01:44:54.004Z",
"customerId": 1,
"ticketTypeId": 6
}
```
***
### Get Order detail
##### `Get /orders/:id`
**Auth required :** Yes
#### Example Request
```json
orderId = 117
```
#### Example Response
```json
{
"order": {
"id": 117,
"orderNo": null,
"orderQty": 2,
"amount": "198",
"description": "ยูโร2020 รายเกมวีค 37",
"customerTelno": "",
"paymentGateway": "ChillPay",
"paymentMethod": "creditcard",
"transactionId": "52363",
"status": "SUCCESSFUL",
"smilepay": {},
"createdAt": "2021-05-18T14:38:46.956Z",
"updatedAt": "2021-05-18T14:46:38.866Z",
"customerId": 6,
"ticketTypeId": 7
},
"metadata": {
"batchId": 38,
"contestId": 75,
"roundId": 37,
"ticketTypeId": 7,
"code": "EU20-WEEK37",
"description": "ยูโร2020 รายเกมวีค 37",
"price": 99,
"ticketQty":2,
"contestType": "PAID"
}
}
```
***
### Redeem code
##### `PATCH /coupons`
**Auth required :** Yes
#### Example Request
```json
{
code:'123456'
}
```
#### Example Response
```json
{}
```
***
## Payment
### Chill Pay - Request payment
##### `POST /chill-pay/request-payment`
**Auth required :** Yes
#### Example Request
```json
{
"orderId": 22,
"channelCode": "creditcard"
}
```
** channelCode in this term is PaymentMethod enum
#### Example Response
```json
{
"paymentUrl": "https://sandbox-cdnv3.chillpay.co/payment/2a342efc038a936d99e40c2d704d328d0b1b7e56/internetbank",
"transactionId": 49352,
"amount": 4000,
"code": 200
}
```
***
### Chill Pay - Confirm Order(Background)
##### `POST /chill-pay/payment-status`
**Auth required :** No
#### Example Request
```json
{
** ChillPay request **
}
```
#### Example Response
```json
HTTP Status 200 OK
```
***
### Chill Pay - Payment result
** Frontend must send the ChillPay's callback response to this endpoint
##### `POST /chill-pay/payment-result`
**Auth required :** No
#### Example Request
```json
{
"respCode": 0,
"status": "success",
"transNo": 1,
"orderNo": "12345"
}
```
#### Example Response
```json
HTTP Status 200 OK
```
***
***
### SmilePay - Request OTP code
##### `POST /smilepay/requestTx`
**Auth required :** No
#### Example Request
```json=
{
"mobileNumber":"0961234567",
"orderId": 21
}
```
#### Example Response
```json
{
"params": {
"orderStatus": "PENDING",
"auth_code":"Cb1c543jk2l432ljlrewo3j4",
"otp_ref":"ZGPX"
"amount":99,
},
"msg": 'request OTP successful',
"status": 200
}
```
***
### SmilePay - Confirm OTP/Payment
##### `POST /smilepay/confirmTx`
**Auth required :** No
#### Example Request
```json
{
"orderId": 21;
"otp_code": 111111;
"mobileNumber": "0962345678";
}
```
#### Example Response
```json
{
"orderStatus":"SUCCESS",
"code": "success",
"message": "transaction_successful",
"status": 200
}
```
***
## FirstPage
### Default Config
##### `GET /first-page/default-config`
**Auth required :** Yes
#### Example Response
```json=
{
"competitionList": [
{
"title": "Premier League",
"parentBatchId": 1,
"batchType": "Season"
}
]
}
```
***
### League Config
##### `GET /first-page/league-config`
**Auth required :** Yes
#### Example Response
```json=
{
"currentRoundId": 37,
"contestTypeList": [
"FREE",
"PAID"
],
"timeNextGW": "2021-05-23T14:00:00.000Z"
}
```
***
### TopFive leaderboard
##### `GET /first-page/top-five`
**Auth required :** Yes
#### Example Request
```json=
{
"parentBatchId":1
}
```
#### Example Response
```json=
{
"teams": [
{
"rank": 1,
"point": 14,
"roundId": 2,
"contestId": 5,
"id": 1171560,
"imgThumbnail": "",
"title": "test1773093",
"contestType": "PAID"
},
{
"rank": 2,
"point": 13,
"roundId": 2,
"contestId": 5,
"id": 1172392,
"imgThumbnail": "",
"title": "test2735531",
"contestType": "PAID"
},
{
"rank": 3,
"point": 12,
"roundId": 2,
"contestId": 5,
"id": 1173909,
"imgThumbnail": "",
"title": "test5324842",
"contestType": "PAID"
},
{
"rank": 4,
"point": 12,
"roundId": 2,
"contestId": 5,
"id": 1173479,
"imgThumbnail": "",
"title": "test5250449",
"contestType": "PAID"
},
{
"rank": 5,
"point": 12,
"roundId": 2,
"contestId": 5,
"id": 1171909,
"imgThumbnail": "",
"title": "test2552018",
"contestType": "PAID"
},
{
"rank": 1,
"point": 14,
"roundId": 2,
"contestId": 6,
"id": 1171522,
"imgThumbnail": "",
"title": "test3430279",
"contestType": "FREE"
},
{
"rank": 2,
"point": 14,
"roundId": 2,
"contestId": 6,
"id": 1171479,
"imgThumbnail": "",
"title": "test1465029",
"contestType": "FREE"
},
{
"rank": 3,
"point": 14,
"roundId": 2,
"contestId": 6,
"id": 1174160,
"imgThumbnail": "",
"title": "test7521811",
"contestType": "FREE"
},
{
"rank": 4,
"point": 13,
"roundId": 2,
"contestId": 6,
"id": 1171118,
"imgThumbnail": "",
"title": "test128797",
"contestType": "FREE"
},
{
"rank": 5,
"point": 12,
"roundId": 2,
"contestId": 6,
"id": 1173834,
"imgThumbnail": "",
"title": "test9874586",
"contestType": "FREE"
}
]
}
```
## Contest
### Get leaderboard
##### `GET /contests/:contestId/leader/:roundId`
**Auth required :** Yes
#### Example Request
params
contestId = 8
roundId = 1
#### Example Response
```json=
{
[
{
"rank": 1,
"point": 10,
"roundId": 1,
"contestId": 8,
"teamId": 1230,
"imgThumbnail": "",
"title": "test5750261",
"contestType": "FREE"
},
{
"rank": 2,
"point": 10,
"roundId": 1,
"contestId": 8,
"teamId": 1389,
"imgThumbnail": "",
"title": "test6419221",
"contestType": "FREE"
},
{
"rank": 3,
"point": 9,
"roundId": 1,
"contestId": 8,
"teamId": 1567,
"imgThumbnail": "",
"title": "test7281669",
"contestType": "FREE"
},
.
.
.
{
"rank": 100,
"point": 4,
"roundId": 1,
"contestId": 8,
"teamId": 1144,
"imgThumbnail": "",
"title": "test7486529",
"contestType": "FREE"
}
]
}
```
***
## Auth
### Firebase Registration or Login
##### `POST /auth/firebase`
**Auth required :** No
#### Example Request
```json=
{
"idToken":"FirebaseIdToken",
"name":"MR O",
"notiToken":"fcm token",
"platform":"android"
}
```
#### Example Response
```json=
{
"token":"JWToken"
}
```
### Line Registration or Login
##### `POST /auth/line`
**Auth required :** No
#### Example Request
```json=
{
"idToken":"LineIdToken",
"name":"MR O",
"notiToken":"fcm token",
"platform":"ios"
}
```
#### Example Response
```json=
{
"token":"JWToken"
}
```
### Custom Email/password registration
##### `POST /auth/custom/register`
**Auth required :** No
#### Example Request
```json=
{
"email":"pakorn@midassoft.dev",
"password":"passw", // minimum 5 chars
"name":"midassoft"
}
```
#### Example Response
**VERIFY EMAIL SENT TO CUSTOMER with JWToken**
```json=
{
"ok:true
}
```
### Custom Login with email/password
##### `POST /auth/custom/login`
**Auth required :** No
#### Example Request
```json=
{
"email": "pakorn@midassoft.dev",
"password": "passw",
"notiToken":"fcm token",
"platform":"ios"
}
```
#### Example Response
```json=
{
"ok": true
}
```
### Custom verify email
##### `GET /auth/custom/verify-email?verifyToken=JWToken`
**Auth required :** No
#### Example Request
```json=
{
"email": "pakorn@midassoft.dev",
"password": "passw!"
}
```
#### Example Response
```json=
{
"ok": true
}
```
### Custom verify email
##### `GET /auth/custom/resend-verify-email`
**Auth required :** No
#### Example Request
**VERIFY EMAIL SENT TO CUSTOMER with JWToken**
```json=
{
"email": "pakorn@midassoft.dev",
"timestamp": 231312323 //Date.now()
}
```
#### Example Response
```json=
{
"ok": true
}
```
### Custom password reset init
##### `GET /auth/custom/password-reset-init
**Auth required :** No
#### Example Request
```json=
{
"email": "pakorn@midassoft.dev",
}
```
#### Example Response
**PASSWORD RESET EMAIL SENT TO CUSTOMER**
```json=
{
"ok": true
}
```
### Custom SET NEW PASSWORD
##### `GET /auth/custom/password-reset
**Auth required :** No
#### Example Request
```json=
{
"resetToken": "JWToken",
"password":"passw2",
"confirmPassword":"passw2"
}
```
#### Example Response
**PASSWORD RESET EMAIL SENT TO CUSTOMER**
```json=
{
"ok": true
}
```
***
## Live Score
### Live score First Page
##### `POST /`
**Auth required :** Yes
#### Example Request
**Send the date which want match fixture of that day**
*** if frontend not send the date, then default value will be current date ***
```json=
{
"date": "2021-06-26T02:00:00.938Z"
}
```
#### Example Response
```json=
{
"3": {
"competitionId": 3,
"title": "Euro20 Tournament",
"seasonId": 2020,
"matches": [
{
"matchId": 2041917,
"matchTime": "2021-06-26T19:00:00.000Z",
"home": {
"clubId": 119,
"name": "Italy",
"abbr": "ITA",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=119",
"score": 2
},
"away": {
"clubId": 515,
"name": "Austria",
"abbr": "AUT",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=515",
"score": 1
}
},
{
"matchId": 2041920,
"matchTime": "2021-06-27T16:00:00.000Z",
"home": {
"clubId": 366,
"name": "Netherlands",
"abbr": "NED",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=366",
"score": 0
},
"away": {
"clubId": 367,
"name": "Czech Republic",
"abbr": "CZE",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=367",
"score": 2
}
}
]
}
}
```
***
### Live score Match Data
##### `GET /match-data/:matchId`
**Auth required :** Yes
#### Example Request
Param = 2041921
#### Example Response
```json=
{
"score": {
"competitionId": 3,
"seasonId": 2020,
"matchId": 2041921,
"home": {
"clubId": 368,
"name": "France",
"abbr": "FRA",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=368",
"score": 3
},
"away": {
"clubId": 497,
"name": "Switzerland",
"abbr": "SUI",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=497",
"score": 3
},
"stadium": "National Arena"
},
"info": {
"matchId": 2041921,
"home": {
"clubId": 368,
"name": "France",
"abbr": "FRA",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=368",
"score": 3
},
"away": {
"clubId": 497,
"name": "Switzerland",
"abbr": "SUI",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=497",
"score": 3
},
"timeline": [
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "14",
"period": 1,
"actionCode": "SCORE",
"footballer": [
{
"footballerId": 60841,
"firstName": "Haris",
"lastName": "Seferovic",
"abbr": "Haris Seferovic",
"action": "scorer"
},
{
"footballerId": 52046,
"firstName": "Steven",
"lastName": "Zuber",
"abbr": "Steven Zuber",
"action": "assist"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "29",
"period": 1,
"actionCode": "YELLOW_CARD",
"footballer": [
{
"footballerId": 90152,
"firstName": "Raphael",
"lastName": "Varane",
"abbr": "Raphael Varane",
"action": "yellow"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "31",
"period": 1,
"actionCode": "YELLOW_CARD",
"footballer": [
{
"footballerId": 173774,
"firstName": "Nico",
"lastName": "Elvedi",
"abbr": "Nico Elvedi",
"action": "yellow"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "45+204772",
"period": 1,
"actionCode": "END_FIRST_HALF",
"footballer": []
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 1,
"actionCode": "HALF_TIME",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "0",
"period": 2,
"actionCode": "HALF_TIME",
"footballer": []
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 2,
"actionCode": "HALF_TIME",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "45",
"period": 2,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 129508,
"firstName": "Kingsley",
"lastName": "Coman",
"abbr": "Kingsley Coman",
"action": "in"
},
{
"footballerId": 171101,
"firstName": "Clément",
"lastName": "Lenglet",
"abbr": "Clément Lenglet",
"action": "out"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "54",
"period": 2,
"actionCode": "PENALTY_MISSED",
"footballer": [
{
"footballerId": 69305,
"firstName": "Ricardo",
"lastName": "Rodríguez",
"abbr": "Ricardo Rodríguez",
"action": "penalty_missed"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "56",
"period": 2,
"actionCode": "SCORE",
"footballer": [
{
"footballerId": 19927,
"firstName": "Karim",
"lastName": "Benzema",
"abbr": "Karim Benzema",
"action": "scorer"
},
{
"footballerId": 220160,
"firstName": "Kylian",
"lastName": "Mbappé",
"abbr": "Kylian Mbappé",
"action": "assist"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "58",
"period": 2,
"actionCode": "SCORE",
"footballer": [
{
"footballerId": 19927,
"firstName": "Karim",
"lastName": "Benzema",
"abbr": "Karim Benzema",
"action": "scorer"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "61",
"period": 2,
"actionCode": "YELLOW_CARD",
"footballer": [
{
"footballerId": 69305,
"firstName": "Ricardo",
"lastName": "Rodríguez",
"abbr": "Ricardo Rodríguez",
"action": "yellow"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "72",
"period": 2,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 68309,
"firstName": "Mario",
"lastName": "Gavranovic",
"abbr": "Mario Gavranovic",
"action": "in"
},
{
"footballerId": 68312,
"firstName": "Xherdan",
"lastName": "Shaqiri",
"abbr": "Xherdan Shaqiri",
"action": "out"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "72",
"period": 2,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 120721,
"firstName": "Kevin",
"lastName": "Mbabu",
"abbr": "Kevin Mbabu",
"action": "in"
},
{
"footballerId": 120781,
"firstName": "Silvan",
"lastName": "Widmer",
"abbr": "Silvan Widmer",
"action": "out"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "74",
"period": 2,
"actionCode": "SCORE",
"footballer": [
{
"footballerId": 74208,
"firstName": "Paul",
"lastName": "Pogba",
"abbr": "Paul Pogba",
"action": "scorer"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "75",
"period": 2,
"actionCode": "YELLOW_CARD",
"footballer": [
{
"footballerId": 84450,
"firstName": "Granit",
"lastName": "Xhaka",
"abbr": "Granit Xhaka",
"action": "yellow"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "78",
"period": 2,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 229237,
"firstName": "Christian",
"lastName": "Fassnacht",
"abbr": "Christian Fassnacht",
"action": "in"
},
{
"footballerId": 52046,
"firstName": "Steven",
"lastName": "Zuber",
"abbr": "Steven Zuber",
"action": "out"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "79",
"period": 2,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 429534,
"firstName": "Ruben",
"lastName": "Vargas",
"abbr": "Ruben Vargas",
"action": "in"
},
{
"footballerId": 181007,
"firstName": "Breel",
"lastName": "Embolo",
"abbr": "Breel Embolo",
"action": "out"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "80",
"period": 2,
"actionCode": "SCORE",
"footballer": [
{
"footballerId": 60841,
"firstName": "Haris",
"lastName": "Seferovic",
"abbr": "Haris Seferovic",
"action": "scorer"
},
{
"footballerId": 120721,
"firstName": "Kevin",
"lastName": "Mbabu",
"abbr": "Kevin Mbabu",
"action": "assist"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "86",
"period": 2,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 52156,
"firstName": "Admir",
"lastName": "Mehmedi",
"abbr": "Admir Mehmedi",
"action": "in"
},
{
"footballerId": 69305,
"firstName": "Ricardo",
"lastName": "Rodríguez",
"abbr": "Ricardo Rodríguez",
"action": "out"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "87",
"period": 2,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 45268,
"firstName": "Moussa",
"lastName": "Sissoko",
"abbr": "Moussa Sissoko",
"action": "in"
},
{
"footballerId": 76650,
"firstName": "Antoine",
"lastName": "Griezmann",
"abbr": "Antoine Griezmann",
"action": "out"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "87",
"period": 2,
"actionCode": "YELLOW_CARD",
"footballer": [
{
"footballerId": 129508,
"firstName": "Kingsley",
"lastName": "Coman",
"abbr": "Kingsley Coman",
"action": "yellow"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "89",
"period": 2,
"actionCode": "SCORE",
"footballer": [
{
"footballerId": 68309,
"firstName": "Mario",
"lastName": "Gavranovic",
"abbr": "Mario Gavranovic",
"action": "scorer"
},
{
"footballerId": 84450,
"firstName": "Granit",
"lastName": "Xhaka",
"abbr": "Granit Xhaka",
"action": "assist"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 2,
"actionCode": "END_SECOND_HALF",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "0",
"period": 2,
"actionCode": "END_SECOND_HALF",
"footballer": []
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 3,
"actionCode": "START_EXTRA_TIME",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "0",
"period": 3,
"actionCode": "START_EXTRA_TIME",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "90",
"period": 3,
"actionCode": "YELLOW_CARD",
"footballer": [
{
"footballerId": 202675,
"firstName": "Benjamin",
"lastName": "Pavard",
"abbr": "Benjamin Pavard",
"action": "yellow"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "93",
"period": 3,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 44346,
"firstName": "Olivier",
"lastName": "Giroud",
"abbr": "Olivier Giroud",
"action": "in"
},
{
"footballerId": 19927,
"firstName": "Karim",
"lastName": "Benzema",
"abbr": "Karim Benzema",
"action": "out"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "96",
"period": 3,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 119471,
"firstName": "Fabian",
"lastName": "Schär",
"abbr": "Fabian Schär",
"action": "in"
},
{
"footballerId": 60841,
"firstName": "Haris",
"lastName": "Seferovic",
"abbr": "Haris Seferovic",
"action": "out"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 3,
"actionCode": "END_FIRST_EXTRA",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "0",
"period": 3,
"actionCode": "END_FIRST_EXTRA",
"footballer": []
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 4,
"actionCode": "HALF_EXTRA_TIME",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "0",
"period": 4,
"actionCode": "HALF_EXTRA_TIME",
"footballer": []
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "107",
"period": 4,
"actionCode": "YELLOW_CARD",
"footballer": [
{
"footballerId": 211975,
"firstName": "Manuel",
"lastName": "Akanji",
"abbr": "Manuel Akanji",
"action": "yellow"
}
]
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "110",
"period": 4,
"actionCode": "SUBSTITUTE",
"footballer": [
{
"footballerId": 205880,
"firstName": "Marcus",
"lastName": "Thuram",
"abbr": "Marcus Thuram",
"action": "in"
},
{
"footballerId": 129508,
"firstName": "Kingsley",
"lastName": "Coman",
"abbr": "Kingsley Coman",
"action": "out"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 4,
"actionCode": "END_SECOND_EXTRA",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "0",
"period": 4,
"actionCode": "END_SECOND_EXTRA",
"footballer": []
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "120",
"period": 5,
"actionCode": "PENALTY_MISSED",
"footballer": [
{
"footballerId": 68309,
"firstName": "Mario",
"lastName": "Gavranovic",
"abbr": "Mario Gavranovic",
"action": "penalty_missed"
}
]
},
...
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "128",
"period": 5,
"actionCode": "PENALTY_MISSED",
"footballer": [
{
"footballerId": 220160,
"firstName": "Kylian",
"lastName": "Mbappé",
"abbr": "Kylian Mbappé",
"action": "penalty_missed"
}
]
},
{
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"gameTime": "0",
"period": 14,
"actionCode": "FULL_TIME",
"footballer": []
},
{
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"gameTime": "0",
"period": 14,
"actionCode": "FULL_TIME",
"footballer": []
}
],
"referees": {
"Referee": "Fernando Rapallini",
"Lineman1": "Juan Pablo Belatti",
"Lineman2": "Diego Yamil Bonfá",
"FourthOfficial": "Bartosz Frankowski",
"VideoAssistantReferee": "Juan Martínez Munuera",
"AssistantVarOfficial": "Alejandro José Hernández Hernández"
}
},
"stat": {
"possession": {
"home": 54.1,
"away": 45.9
},
"totalShots": {
"home": 26,
"away": 12
},
"shotsOnTarget": {
"home": 8,
"away": 5
},
"touches": {
"home": 862,
"away": 763
},
"passes": {
"home": 623,
"away": 534
},
"tackles": {
"home": 17,
"away": 21
},
"clearances": {
"home": 22,
"away": 33
},
"offsides": {
"home": 1,
"away": 1
},
"yellowCards": {
"home": 3,
"away": 4
},
"redCards": {
"home": 0,
"away": 0
}
},
"lineup": {
"home": {
"clubId": 368,
"clubName": "France",
"clubAbbr": "FRA",
"clubImage": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=368",
"jerseyImage": "https://ksngg-assets.s3-ap-southeast-1.amazonaws.com/jersey/france.png",
"formation": "3-4-1-2",
"manager": "Didier Deschamps",
"startingXI": [
[
{
"footballerId": 37915,
"firstName": "Hugo",
"lastName": "Lloris",
"abbr": "Hugo Lloris",
"gamePosition": "Goalkeeper",
"xAxis": 50,
"yAxis": 12,
"formattedPosition": "Goalkeeper"
}
],
[
{
"footballerId": 129479,
"firstName": "Presnel",
"lastName": "Kimpembe",
"abbr": "Presnel Kimpembe",
"gamePosition": "Defender",
"xAxis": 76,
"yAxis": 32,
"formattedPosition": "Left Central Defender"
},
{
"footballerId": 171101,
"firstName": "Clément",
"lastName": "Lenglet",
"abbr": "Clément Lenglet",
"gamePosition": "Defender",
"xAxis": 50,
"yAxis": 32,
"formattedPosition": "Central Defender"
},
{
"footballerId": 90152,
"firstName": "Raphael",
"lastName": "Varane",
"abbr": "Raphael Varane",
"gamePosition": "Defender",
"xAxis": 24,
"yAxis": 32,
"formattedPosition": "Right Central Defender"
}
],
[
{
"footballerId": 120743,
"firstName": "Adrien",
"lastName": "Rabiot",
"abbr": "Adrien Rabiot",
"gamePosition": "Midfielder",
"xAxis": 87,
"yAxis": 56,
"formattedPosition": "Left Midfielder"
},
{
"footballerId": 116594,
"firstName": "N'Golo",
"lastName": "Kanté",
"abbr": "N'Golo Kanté",
"gamePosition": "Midfielder",
"xAxis": 62,
"yAxis": 50,
"formattedPosition": "Left Defensive Midfielder"
},
{
"footballerId": 74208,
"firstName": "Paul",
"lastName": "Pogba",
"abbr": "Paul Pogba",
"gamePosition": "Midfielder",
"xAxis": 38,
"yAxis": 50,
"formattedPosition": "Right Defensive Midfielder"
},
{
"footballerId": 202675,
"firstName": "Benjamin",
"lastName": "Pavard",
"abbr": "Benjamin Pavard",
"gamePosition": "Midfielder",
"xAxis": 13,
"yAxis": 56,
"formattedPosition": "Right Midfielder"
}
],
[
{
"footballerId": 76650,
"firstName": "Antoine",
"lastName": "Griezmann",
"abbr": "Antoine Griezmann",
"gamePosition": "Forward",
"xAxis": 50,
"yAxis": 71,
"formattedPosition": "Second Striker"
}
],
[
{
"footballerId": 220160,
"firstName": "Kylian",
"lastName": "Mbappé",
"abbr": "Kylian Mbappé",
"gamePosition": "Forward",
"xAxis": 65,
"yAxis": 90,
"formattedPosition": "Left Striker"
},
{
"footballerId": 19927,
"firstName": "Karim",
"lastName": "Benzema",
"abbr": "Karim Benzema",
"gamePosition": "Forward",
"xAxis": 35,
"yAxis": 90,
"formattedPosition": "Right Striker"
}
]
],
"substitutes": [
{
"footballerId": 167449,
"firstName": "Thomas",
"lastName": "Lemar",
"abbr": "Thomas Lemar",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 44346,
"firstName": "Olivier",
"lastName": "Giroud",
"abbr": "Olivier Giroud",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 168568,
"firstName": "Corentin",
"lastName": "Tolisso",
"abbr": "Corentin Tolisso",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 103192,
"firstName": "Kurt",
"lastName": "Zouma",
"abbr": "Kurt Zouma",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 44413,
"firstName": "Steve",
"lastName": "Mandanda",
"abbr": "Steve Mandanda",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 45268,
"firstName": "Moussa",
"lastName": "Sissoko",
"abbr": "Moussa Sissoko",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 129508,
"firstName": "Kingsley",
"lastName": "Coman",
"abbr": "Kingsley Coman",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 174888,
"firstName": "Lucas",
"lastName": "Hernández",
"abbr": "Lucas Hernández",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 83912,
"firstName": "Wissam",
"lastName": "Ben Yedder",
"abbr": "Wissam Ben Yedder",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 129487,
"firstName": "Mike",
"lastName": "Maignan",
"abbr": "Mike Maignan",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 183779,
"firstName": "Léo",
"lastName": "Dubois",
"abbr": "Léo Dubois",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 205880,
"firstName": "Marcus",
"lastName": "Thuram",
"abbr": "Marcus Thuram",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
}
]
},
"away": {
"clubId": 497,
"clubName": "Switzerland",
"clubAbbr": "SUI",
"clubImage": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=497",
"jerseyImage": "https://ksngg-assets.s3-ap-southeast-1.amazonaws.com/jersey/switzerland.png",
"formation": "3-4-1-2",
"manager": "Vladimir Petkovic",
"startingXI": [
[
{
"footballerId": 34683,
"firstName": "Yann",
"lastName": "Sommer",
"abbr": "Yann Sommer",
"gamePosition": "Goalkeeper",
"xAxis": 50,
"yAxis": 12,
"formattedPosition": "Goalkeeper"
}
],
[
{
"footballerId": 69305,
"firstName": "Ricardo",
"lastName": "Rodríguez",
"abbr": "Ricardo Rodríguez",
"gamePosition": "Defender",
"xAxis": 76,
"yAxis": 32,
"formattedPosition": "Left Central Defender"
},
{
"footballerId": 211975,
"firstName": "Manuel",
"lastName": "Akanji",
"abbr": "Manuel Akanji",
"gamePosition": "Defender",
"xAxis": 50,
"yAxis": 32,
"formattedPosition": "Central Defender"
},
{
"footballerId": 173774,
"firstName": "Nico",
"lastName": "Elvedi",
"abbr": "Nico Elvedi",
"gamePosition": "Defender",
"xAxis": 24,
"yAxis": 32,
"formattedPosition": "Right Central Defender"
}
],
[
{
"footballerId": 52046,
"firstName": "Steven",
"lastName": "Zuber",
"abbr": "Steven Zuber",
"gamePosition": "Midfielder",
"xAxis": 87,
"yAxis": 56,
"formattedPosition": "Left Midfielder"
},
{
"footballerId": 84450,
"firstName": "Granit",
"lastName": "Xhaka",
"abbr": "Granit Xhaka",
"gamePosition": "Midfielder",
"xAxis": 62,
"yAxis": 50,
"formattedPosition": "Left Defensive Midfielder"
},
{
"footballerId": 89076,
"firstName": "Remo",
"lastName": "Freuler",
"abbr": "Remo Freuler",
"gamePosition": "Midfielder",
"xAxis": 38,
"yAxis": 50,
"formattedPosition": "Right Defensive Midfielder"
},
{
"footballerId": 120781,
"firstName": "Silvan",
"lastName": "Widmer",
"abbr": "Silvan Widmer",
"gamePosition": "Midfielder",
"xAxis": 13,
"yAxis": 56,
"formattedPosition": "Right Wing Back"
}
],
[
{
"footballerId": 68312,
"firstName": "Xherdan",
"lastName": "Shaqiri",
"abbr": "Xherdan Shaqiri",
"gamePosition": "Forward",
"xAxis": 50,
"yAxis": 71,
"formattedPosition": " Attacking Midfielder"
}
],
[
{
"footballerId": 60841,
"firstName": "Haris",
"lastName": "Seferovic",
"abbr": "Haris Seferovic",
"gamePosition": "Forward",
"xAxis": 65,
"yAxis": 90,
"formattedPosition": "Left Striker"
},
{
"footballerId": 181007,
"firstName": "Breel",
"lastName": "Embolo",
"abbr": "Breel Embolo",
"gamePosition": "Forward",
"xAxis": 35,
"yAxis": 90,
"formattedPosition": "Right Striker"
}
]
],
"substitutes": [
{
"footballerId": 120721,
"firstName": "Kevin",
"lastName": "Mbabu",
"abbr": "Kevin Mbabu",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 212701,
"firstName": "Denis",
"lastName": "Zakaria",
"abbr": "Denis Zakaria",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 429534,
"firstName": "Ruben",
"lastName": "Vargas",
"abbr": "Ruben Vargas",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 100952,
"firstName": "Yvon",
"lastName": "Mvogo",
"abbr": "Yvon Mvogo",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 185524,
"firstName": "Djibril",
"lastName": "Sow",
"abbr": "Djibril Sow",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 229237,
"firstName": "Christian",
"lastName": "Fassnacht",
"abbr": "Christian Fassnacht",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 68260,
"firstName": "Loris",
"lastName": "Benito",
"abbr": "Loris Benito",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 52156,
"firstName": "Admir",
"lastName": "Mehmedi",
"abbr": "Admir Mehmedi",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 68309,
"firstName": "Mario",
"lastName": "Gavranovic",
"abbr": "Mario Gavranovic",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 163526,
"firstName": "Edimilson",
"lastName": "Fernandes",
"abbr": "Edimilson Fernandes",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 185513,
"firstName": "Gregor",
"lastName": "Kobel",
"abbr": "Gregor Kobel",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
},
{
"footballerId": 119471,
"firstName": "Fabian",
"lastName": "Schär",
"abbr": "Fabian Schär",
"gamePosition": "Substitute",
"xAxis": null,
"yAxis": null
}
]
}
}
}
```
***
### Live score Table
##### `GET /table/:competitionId/season/:seasonId`
**Auth required :** Yes
#### Example Request
competitionId = 3
seasonId = 2020
#### Example Response
```json=
{
"A": [
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 119,
"name": "Italy",
"abbr": "ITA",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=119"
},
"rank": 1,
"plays": 3,
"win": 3,
"draw": 0,
"losses": 0,
"goalFor": 7,
"goalAgainst": 0,
"goalDifference": 7,
"points": 9
},
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 508,
"name": "Wales",
"abbr": "WAL",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=508"
},
"rank": 2,
"plays": 3,
"win": 1,
"draw": 1,
"losses": 1,
"goalFor": 3,
"goalAgainst": 2,
"goalDifference": 1,
"points": 4
},
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 497,
"name": "Switzerland",
"abbr": "SUI",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=497"
},
"rank": 3,
"plays": 3,
"win": 1,
"draw": 1,
"losses": 1,
"goalFor": 4,
"goalAgainst": 5,
"goalDifference": -1,
"points": 4
},
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 362,
"name": "Turkey",
"abbr": "TUR",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=362"
},
"rank": 4,
"plays": 3,
"win": 0,
"draw": 0,
"losses": 3,
"goalFor": 1,
"goalAgainst": 8,
"goalDifference": -7,
"points": 0
}
],
"B": [
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 360,
"name": "Belgium",
"abbr": "BEL",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=360"
},
"rank": 1,
"plays": 3,
"win": 3,
"draw": 0,
"losses": 0,
"goalFor": 7,
"goalAgainst": 1,
"goalDifference": 6,
"points": 9
},
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 369,
"name": "Denmark",
"abbr": "DEN",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=369"
},
"rank": 2,
"plays": 3,
"win": 1,
"draw": 0,
"losses": 2,
"goalFor": 5,
"goalAgainst": 4,
"goalDifference": 1,
"points": 3
},
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 518,
"name": "Finland",
"abbr": "FIN",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=518"
},
"rank": 3,
"plays": 3,
"win": 1,
"draw": 0,
"losses": 2,
"goalFor": 1,
"goalAgainst": 3,
"goalDifference": -2,
"points": 3
},
{
"spCompetitionId": 3,
"spCompetitionName": "European Championship Finals",
"spSeasonId": 2020,
"spSeasonName": "European Championship Finals",
"batchType": "Tournament",
"round": 1,
"club": {
"id": 536,
"name": "Russia",
"abbr": "RUS",
"thumbnail": "https://omo.akamai.opta.net/image.php?h=omo.akamai.opta.net&sport=football&entity=team&description=badges&dimensions=150&id=536"
},
"rank": 4,
"plays": 3,
"win": 1,
"draw": 0,
"losses": 2,
"goalFor": 2,
"goalAgainst": 7,
"goalDifference": -5,
"points": 3
}
],
...
}
```
***