-
Notifications
You must be signed in to change notification settings - Fork 0
Player API
atsanan edited this page Sep 16, 2019
·
17 revisions
GET /api/v1/player/info?fields=player,user
| Field | Description | Optional | Auth |
|---|---|---|---|
| fields | Set of fields selections (user, player) | NO | Yes |
{
"data": {
"player": {
"id": "5b2ca882bdfdd84f1fa5fe44",
"userId": "5b2ca881bdfdd84f1fa5fe40",
"playerName": "undefined",
"teamPlayerId": -1,
"coin": 501,
"diamond": 10,
"costumeSelectId": 1,
"costumeList": [
1,
2
],
"createAt": "0001-01-01T00:00:00Z",
"lastModified": "2018-06-22T11:10:52.845Z"
},
"user": {
"id": "5b2ca881bdfdd84f1fa5fe40",
"name": "Nattapon Rattajak",
"firstname": "Nattapon",
"lastname": "Rattajak",
"gender": "male",
"birthdate": "11/06/1989",
"password": "",
"email": "nattapon.r@live.com",
"tel": "",
"authenTypeId": 1,
"authenId": "10203051208741885",
"authenToken": "",
"verified": true,
"verifiedAt": "2018-06-22T07:47:35.04Z",
"createAt": "2018-06-22T07:47:35.04Z",
"lastModified": "0001-01-01T00:00:00Z"
}
},
"isSuccess": true
}GET /api/v1/player/coinAndDiamond
**(No longer maintenance please use /player/info instead.)**
POST /api/v1/player/coinAndDiamond
| Field | Description | Optional | Auth |
|---|---|---|---|
| coin | Coin is the currency, that use in game can get in play | Yes | Yes |
| diamond | Diamond is rare currnecy, that is used for in-app purchase | Yes | Yes |
{
"data": {
"_id": "5b2ca882bdfdd84f1fa5fe44",
"coin": 501,
"diamond": 10
},
"isSuccess": true
}- GET /api/v1/player/costume (No longer maintenance please use /player/info instead.)
- POST /api/v1/player/costume
- POST /api/v1/player/costume/new (buy new costume)
| Field | Description | Optional | Auth |
|---|---|---|---|
| costumeSelectId | ID of the selected costume | No | Yes |
{
"data": {
"id": "5b2ca882bdfdd84f1fa5fe44",
"userId": "5b2ca881bdfdd84f1fa5fe40",
"playerName": "undefined",
"teamPlayerId": -1,
"coin": 501,
"diamond": 10,
"costumeSelectId": 2,
"costumeList": [
1,
2
],
"createAt": "0001-01-01T00:00:00Z",
"lastModified": "2018-06-22T10:59:44.144Z"
},
"isSuccess": true
}-
GET /api/v1/player/teamplayer (No longer maintenance please use /player/info instead.)
-
POST /api/v1/player/teamplayer
| Field | Description | Optional | Auth |
|---|---|---|---|
| teamPlayerId | Team type of game | No | Yes |
{
"data": {
"id": "5b2ca882bdfdd84f1fa5fe44",
"userId": "5b2ca881bdfdd84f1fa5fe40",
"playerName": "undefined",
"teamPlayerId": 1,
"coin": 501,
"diamond": 10,
"costumeSelectId": 1,
"costumeList": [
1,
2
],
"createAt": "0001-01-01T00:00:00Z",
"lastModified": "2018-06-22T11:58:12.412Z"
},
"isSuccess": true
}- GET /api/v1/player/all?page=0&limit=10
| Field | Description | Optional | Default | Authen |
|---|---|---|---|---|
| page | Current index of page | Yes | 0 | admin |
| limit | Maximum number of page | Yes | 10 | admin |
{
"data": {
"pageIndex": 0,
"pageLimit": 1,
"pages": 2,
"paging": {
"next": "/api/v1/players?page=1&limit=1",
"previous": ""
},
"players": [
{
"id": "5b2ca882bdfdd84f1fa5fe44",
"userId": "5b2ca881bdfdd84f1fa5fe40",
"playerName": "undefined",
"teamPlayerId": 1,
"coin": 501,
"diamond": 10,
"costumeSelectId": 1,
"costumeList": [
1,
2
],
"createAt": "0001-01-01T00:00:00Z",
"lastModified": "2018-06-22T11:58:12.412Z"
}
]
},
"isSuccess": true
}DELETE /api/v1/player/{id} **Not yet implemented**
Note
Delete data table "MonsterPlayer" where playerId
Delete data table "ItemPlayer" where playerId
Delete data table "JoinChannel" where playerId
Delete data table "MonsterStickers" where sendFromId or sendToId
Query parameters: Returns:
{
isSuccess : bool,
errorCode : int,
errorMessage : string
}POST /api/v1/player/{id : string}
| Field | Description | Optional | Auth |
|---|---|---|---|
| playerName | Name of the player | No | admin |
| teamPlayerId | Team's ID from selected | No | |
| coin | Current coins of player | No | |
| diamond | Current diamonds of player | No | |
| costumeSelectId | Selected costume ID | No | |
| costumeList | All Costume's ID, that player have | No |
{
"data": {
"id": "5b2ca882bdfdd84f1fa5fe44",
"userId": "5b2ca881bdfdd84f1fa5fe40",
"playerName": "test boobo",
"teamPlayerId": 1,
"coin": 1,
"diamond": 500,
"costumeSelectId": 1,
"costumeList": [],
"createAt": "0001-01-01T00:00:00Z",
"lastModified": "2018-06-25T11:40:46.218Z"
},
"isSuccess": true
}POST /api/v1/player/{id : string}
| Field | Description | Optional | Auth |
|---|---|---|---|
| gender | gender | No | admin |
| costumeList | costumeList | No | admin |
{
"data": {
"id": "5b2ca882bdfdd84f1fa5fe44",
"userId": "5b2ca881bdfdd84f1fa5fe40",
"playerName": "test boobo",
"teamPlayerId": 1,
"coin": 1,
"diamond": 500,
"costumeSelectId": 1,
"costumeList": [],
"createAt": "0001-01-01T00:00:00Z",
"lastModified": "2018-06-25T11:40:46.218Z"
},
"isSuccess": true
}