| ... | @@ -226,29 +226,82 @@ true |
... | @@ -226,29 +226,82 @@ true |
|
|
|
|
|
|
|
## Rejoin Challenge
|
|
## Rejoin Challenge
|
|
|
|
|
|
|
|
> Desc
|
|
> 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 |
|
|
| Method | Route | Content type | Authentication |
|
|
|
|--------|-------|--------------|----------------|
|
|
|--------|-------|--------------|----------------|
|
|
|
| POST | route | `application/json` | No |
|
|
| GET | /challenge/reJoin | `application/json` | bearer token |
|
|
|
|
|
|
|
|
<details>
|
|
<details><summary><b>Example Responses</b></summary>
|
|
|
<summary><b>Required Body</b></summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
```json
|
|
|
Body
|
|
{
|
|
|
|
"statusCode": 200,
|
|
|
|
"message": "Joining to the challenge room was successfully",
|
|
|
|
"details": {
|
|
|
|
"userId": "3f45526e-1534-48f6-917b-8fb0bf7d4354",
|
|
|
|
"userAvatar": 1,
|
|
|
|
"username": "Test gamer",
|
|
|
|
"isGameMaster": false,
|
|
|
|
"challengeRoomId": "7eaf76ea-b056-433d-98dc-6dc053f862c4",
|
|
|
|
"challengeRoomCode": "ah34",
|
|
|
|
"challengeRoomName": "Test game",
|
|
|
|
"challengeStartDate": "2021-07-23T11:16:08.655Z",
|
|
|
|
"challengeEndDate": "2021-07-23T11:46:08.000Z",
|
|
|
|
"challengeTasks": [
|
|
|
|
{
|
|
|
|
"taskNumber": 1,
|
|
|
|
"taskDescription": "Haaste 1"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"taskNumber": 2,
|
|
|
|
"taskDescription": "Haaste 2"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJMZWFkZXIiOiJFbG1lciIsIlVJVVgiOiJFbGxhIiwiRGV2T3BzIjoiRWV0dSIsIlRlc3RlciI6IklsZGlrbyIsIkZyb250IjoiTWlydmEiLCJGdWxsQXMwIjoiTWFya2t1IiwiRnVsbEFzMSI6Ik9sbGkifQ.vR2qPO_hgUnRXp7lbqgDoOrBfqNvW-o9KCw0i2iM3u8"
|
|
|
|
}
|
|
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
</details>
|
|
```json
|
|
|
|
{
|
|
|
|
"statusCode": 401,
|
|
|
|
"error": "Unauthorized",
|
|
|
|
"message": "Missing authentication"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
<details><summary><b>Example Responses</b></summary>
|
|
```json
|
|
|
|
{
|
|
|
|
"statusCode": 401,
|
|
|
|
"error": "Unauthorized",
|
|
|
|
"message": "Invalid token signature",
|
|
|
|
"attributes": {
|
|
|
|
"error": "Invalid token signature"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
```json
|
|
|
Success
|
|
{
|
|
|
|
"statusCode": 401,
|
|
|
|
"error": "Unauthorized",
|
|
|
|
"message": "Invalid token missing header",
|
|
|
|
"attributes": {
|
|
|
|
"error": "Invalid token missing header"
|
|
|
|
}
|
|
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
```json
|
|
|
Error
|
|
{
|
|
|
|
"statusCode": 401,
|
|
|
|
"error": "Unauthorized",
|
|
|
|
"message": "Invalid token payload",
|
|
|
|
"attributes": {
|
|
|
|
"error": "Invalid token payload"
|
|
|
|
}
|
|
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
</details>
|
|
</details>
|
| ... | |
... | |
| ... | | ... | |