Update New Restful Plan authored by Derek Williams's avatar Derek Williams
| Endpoint | Type | Example(s) |
|---------------------------------------------------|------|------------|
| /login | POST | |
| /logout/{playerID} | GET | |
| /quest | GET | |
| /quest/create | POST | |
| /quest/{questID} | GET | |
| /quest/{questID}/{playerID} | GET | |
| /quest/{questID}/objective | GET | |
| /quest/{questID}/objective/create | POST | |
| /quest/{questID}/objective/{objectiveID} | GET | |
| /quest/{questID}/objective/{objectiveID}/complete | POST | |
| /objective-complete | POST | |
| /objective-fetch-all/{playerID} | GET | |
| /player | POST | |
<br></br>
<br></br>
# Login
| Endpoint | Type | Example(s) |
|----------|------|------------|
| /login | POST | [Login - Successful](New-Restful-Plan#login-successful) <br></br> [Login - Failed](New-Restful-Plan#login-failed) |
| /logout/{playerID} | GET | |
| /quest | GET | |
| /quest/create | POST | |
| /quest/{questID} | GET | |
| /quest/{questID}/{playerID} | GET | |
| /quest/{questID}/objective | GET | |
| /quest/{questID}/objective/create | POST | |
| /quest/{questID}/objective/{objectiveID} | GET | |
| /quest/{questID}/objective/{objectiveID}/complete | POST | |
| /objective-complete | POST | |
| /objective-fetch-all/{playerID} | GET | |
| /player | POST | |
# Login - Successful
This endpoint is responsible to logging in players. A payload consisting of a username/password combination is required. This is an example of a successful login request.
## Request
```http
POST /login
```
## Payload
```json
{
"username": "guest",
"password": "pw"
}
```
## Response
```json
{
"playerID": 41
}
```
<br></br>
<br></br>
# Login - Failed
This is an example of a failed login request.
## Request
```http
POST /login
```
## Payload
```json
{
"username": "guest",
"password": "wrong password"
}
```
## Response
```json
{
"message": "Player: guest failed to login."
}
```
# Logout
## Request
```http
GET /logout/41
```
## Response
```
```plaintext
Player 41 logged out.
```
# Quest List
## Request
```http
GET /quest
```
<br></br>
<br></br>
\ No newline at end of file
## Response
```json
{
"1": {
"id": 1,
"name": "The Best Quest",
"desc": "The Quest that is The Best",
"startDate": "1970-01-01",
"endDate": "9999-12-30"
},
"2": {
"id": 2,
"name": "The Worst Quest",
"desc": "The Quest that is The Worst",
"startDate": "1970-01-01",
"endDate": "9999-12-30"
}
}
```
\ No newline at end of file