| ... | ... | @@ -4,9 +4,9 @@ |
|
|
|
|
|
|
|
> With this endpoint user can create a new challenge room. After game room has been successfully created, user is granted title `GAMEMASTER` and receives the challenge room joining `challengeRoomCode` and a `JWT TOKEN`. With this token the `GAMEMASTER` can be identified and it prevents other users from disguising as the `GAMEMASTER`.
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| POST | /challenge/new | `application/json` | No |
|
|
|
|
| Method | Route | Content type | Authentication |File|
|
|
|
|
|--------|-------|--------------|----------------|--|
|
|
|
|
| POST | /challenge/new | `application/json` | No |[newChallenge](https://gitlab.labranet.jamk.fi/wimma-lab-2022/iotitude/source-backend/-/blob/development/src/routes/challenge/newChallenge.js)|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>Required Body</b></summary>
|
| ... | ... | @@ -79,9 +79,9 @@ |
|
|
|
|
|
|
|
Join Challenge call will trigger `newPlayer` socket to emit array of room's players to the socket listeners.
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| POST | /challenge/join/{roomCode} | `application/json` | No |
|
|
|
|
| Method | Route | Content type | Authentication |File|
|
|
|
|
|--------|-------|--------------|----------------|--|
|
|
|
|
| POST | /challenge/join/{roomCode} | `application/json` | No |[joinChallenge](https://gitlab.labranet.jamk.fi/wimma-lab-2022/iotitude/source-backend/-/blob/development/src/routes/challenge/joinChallenge.js)|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>Required Body</b></summary>
|
| ... | ... | @@ -170,9 +170,9 @@ Join Challenge call will trigger `newPlayer` socket to emit array of room's play |
|
|
|
|
|
|
|
> User can disconnect by using this API route. User's data will be deleted based on game session status where `JWT TOKEN` is connected.
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| GET | /challenge/exit | - | bearer token |
|
|
|
|
| Method | Route | Content type | Authentication |File|
|
|
|
|
|--------|-------|--------------|----------------|--|
|
|
|
|
| GET | /challenge/exit | - | bearer token |[exitChallenge](https://gitlab.labranet.jamk.fi/wimma-lab-2022/iotitude/source-backend/-/blob/development/src/routes/challenge/exitChallenge.js)|
|
|
|
|
|
|
|
|
<details><summary><b>Example Responses</b></summary>
|
|
|
|
|
| ... | ... | @@ -229,9 +229,9 @@ true |
|
|
|
|
|
|
|
> User can rejoin existing game with valid and existing `JWT TOKEN`.<br>`JWT TOKEN` is received when using [Joining the challenge room](/wimma-lab-2022/iotitude/source-backend/-/wikis/API/REST/Join%20Challenge) or [Create new Challenge](/wimma-lab-2022/iotitude/source-backend/-/wikis/API/REST/New%20Challenge) REST API routes
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| GET | /challenge/reJoin | - | bearer token |
|
|
|
|
| Method | Route | Content type | Authentication |File|
|
|
|
|
|--------|-------|--------------|----------------|--|
|
|
|
|
| GET | /challenge/reJoin | - | bearer token |[reJoin](https://gitlab.labranet.jamk.fi/wimma-lab-2022/iotitude/source-backend/-/blob/development/src/routes/challenge/reJoin.js)|
|
|
|
|
|
|
|
|
<details><summary><b>Example Responses</b></summary>
|
|
|
|
|
| ... | ... | @@ -314,9 +314,9 @@ true |
|
|
|
|
|
|
|
> User can send feedback, which will be sent to the project email address.
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| POST | /feedback/send | `application/json` | No |
|
|
|
|
| Method | Route | Content type | Authentication |File|
|
|
|
|
|--------|-------|--------------|----------------|--|
|
|
|
|
| POST | /feedback/send | `application/json` | No |[sendFeedback](https://gitlab.labranet.jamk.fi/wimma-lab-2022/iotitude/source-backend/-/blob/development/src/routes/feedback/sendFeedback.js)|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>Required Body</b></summary>
|
| ... | ... | @@ -354,9 +354,9 @@ true |
|
|
|
|
|
|
|
> Returns submission file's data string.
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| GET | /challenge/fetchfile/{submissionId} | - | Bearer token |
|
|
|
|
| Method | Route | Content type | Authentication |File|
|
|
|
|
|--------|-------|--------------|----------------|--|
|
|
|
|
| GET | /challenge/fetchfile/{submissionId} | - | Bearer token |[fetchFile](https://gitlab.labranet.jamk.fi/wimma-lab-2022/iotitude/source-backend/-/blob/development/src/routes/fileHandler/fetchFile.js)|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>Example Responses</b></summary>
|
| ... | ... | @@ -388,9 +388,9 @@ file data in base64 format |
|
|
|
|
|
|
|
> Adds submission's file to file database (Minio).
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| POST | `/challenge/sendfile` | `application/json` | Bearer token |
|
|
|
|
| Method | Route | Content type | Authentication |File|
|
|
|
|
|--------|-------|--------------|----------------|--|
|
|
|
|
| POST | `/challenge/sendfile` | `application/json` | Bearer token |[addFile](https://gitlab.labranet.jamk.fi/wimma-lab-2022/iotitude/source-backend/-/blob/development/src/routes/fileHandler/addFile.js)|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>Required Body</b></summary>
|
| ... | ... | |
| ... | ... | |