Changes
Page history
Update New Restful Plan
authored
Oct 07, 2022
by
Derek Williams
Show whitespace changes
Inline
Side-by-side
New-Restful-Plan.md
View page @
84c81138
| 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 | |
| /quest | GET | |
| /quest/create | POST | |
...
...
@@ -15,39 +15,99 @@
| /player | POST | |
<br></br>
<br></br>
# Login
# 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
<br></br>
<br></br>
\ No newline at end of file
## Request
```
http
GET /quest
```
## 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