Update New Restful Plan authored by Derek Williams's avatar Derek Williams
| Endpoint | Type | Example(s) | | Endpoint | Type | Example(s) |
|---------------------------------------------------|------|------------| |----------|------|------------|
| /login | POST | | | /login | POST | [Login - Successful](New-Restful-Plan#login-successful) <br></br> [Login - Failed](New-Restful-Plan#login-failed) |
| /logout/{playerID} | GET | | | /logout/{playerID} | GET | |
| /quest | GET | | | /quest | GET | |
| /quest/create | POST | | | /quest/create | POST | |
| /quest/{questID} | GET | | | /quest/{questID} | GET | |
| /quest/{questID}/{playerID} | GET | | | /quest/{questID}/{playerID} | GET | |
| /quest/{questID}/objective | GET | | | /quest/{questID}/objective | GET | |
| /quest/{questID}/objective/create | POST | | | /quest/{questID}/objective/create | POST | |
| /quest/{questID}/objective/{objectiveID} | GET | | | /quest/{questID}/objective/{objectiveID} | GET | |
| /quest/{questID}/objective/{objectiveID}/complete | POST | | | /quest/{questID}/objective/{objectiveID}/complete | POST | |
| /objective-complete | POST | | | /objective-complete | POST | |
| /objective-fetch-all/{playerID} | GET | | | /objective-fetch-all/{playerID} | GET | |
| /player | POST | | | /player | POST | |
<br></br> # Login - Successful
<br></br>
# Login 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 ## Request
```http ```http
POST /login POST /login
``` ```
## Payload ## Payload
```json ```json
{ {
"username": "guest", "username": "guest",
"password": "pw" "password": "pw"
} }
``` ```
## Response ## Response
```json ```json
{ {
"playerID": 41 "playerID": 41
} }
``` ```
<br></br> # Login - Failed
<br></br>
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 # Logout
## Request ## Request
```http ```http
GET /logout/41 GET /logout/41
``` ```
## Response ## Response
```
```plaintext
Player 41 logged out. Player 41 logged out.
``` ```
# Quest List
## Request
```http
GET /quest
```
<br></br> ## Response
<br></br>
\ No newline at end of file ```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