Below is the documentation for the UWHvZ API. Endpoints will be added, and this document is subject to be expanded upon.
All endpoints, except the ones marked with a *, require authentication using two cookies named sessionid
and csrftoken
.
/api/v1/auth/login/
POST
username
: email address of the accountpassword
: password of the account.
Success
Authenticates the user with the associated username. Attaches two cookies with names sessionid
and csrftoken
which identify the user sessions.
401
- Login failure, incorrect credentials.
/api/v1/auth/logout/
GET
None
None
Success
200
- Refreshes csrftoken
and removes sessionid
cookie.
403 Logout Failed
This means you had invalid cookies.
Note: This endpoint is currently only built for players. Moderator and spectator information collecting may be added later.
/api/v1/account_info/
GET
None
None
200
- Returns a JSON Object with the fields:
Name | Type | Description |
---|---|---|
code |
String | Player code as a string |
roleChar |
Char | One character that represents the role of the player. H for human, Z for zombie, and S for spectators |
is_oz |
Boolean | Whether the player is an OZ |
name |
String | Player's name |
email |
String | Player's email |
score |
Integer | Player's score |
shop_score |
Integer | Player's points available for use in the shop. |
game |
Game (see below) | Game that this player is associated with. Use this to check if the user is currently playing. |
faction |
Faction (see below) | Faction that the player is associated with. |
Name | Type | Description |
---|---|---|
name |
String | Game name |
status |
String | This is the game status, and can be either running , finished , or signups . |
started_on | String | Time that the current game started. Given in ISO8601. |
ended_on | String | Time that the current game ended, in ISO8601 format. This field is null if the current game has not finished yet. |
Name | Type | Description |
---|---|---|
name |
String | Name of faction |
description |
String | Faction description |
modifiers |
Array(Modifier, see below) | List of Modifiers that a faction gives. |
Name | Type | Description |
---|---|---|
modifier_amount |
String | Quantity of modifier |
type |
String | Type of modifier - O for one time use, S for supply codes, and T on tags. |
401
: The user is not logged in.
403
: The user is not a player.
/api/v1/view_tags/
Gets all tags associated with logged in player.
GET
None
None
200
- Returns a JSON object with the fields:
Name | Type | Description |
---|---|---|
unverified |
Array of Tag objects (see below) | A list of the unverified tags associated with a player. |
verified |
Array of Tag objects (see below) | A list of the verified tags associated with a player. |
received |
Array of Tag objects (see below) | A list of the received tags associated with a player. |
Name | Type | Description |
---|---|---|
initiator_name |
string | Name of the initiating player. |
initiator_role |
char | A character denoting the role of the initiating player. Should be 'H' or 'Z'. |
receiver_name |
string | Name of the receiving player. |
receiver_role |
char | A character denoting the role of the receiving player. Should be 'H' or 'Z'. |
points |
integer | The points this particular tag is worth, depending on any modifiers plus the value of the receiving player |
location |
string | The location of the tag given. If blank, this was not given when the tag was submitted. |
time |
datetime | A time string in ISO8601 format (Ex: 2020-08-11T19:29:25Z) |
description |
string | The description of the tag given. If blank, this information was not given when the tag was submitted. |
tag_type |
char | A character denoting the type of tag, stun or kill. Should be 'S' or 'K', respectively. |
401
- The user is not logged in.
403
- The user is not a player.
/api/v1/get_player_list/
Gets all players playing in the same game as the logged in user.
GET
None
None
200
- Returns a JSON object with the following fields:
Name | Type | Description |
---|---|---|
players |
List of Player (see below) objects | A list of all active players in the game, either as humans or zombies, sorted in alphabetical order by name. |
moderators |
List of Moderator (see below) objects | A list of all current moderators in the game, sorted in alphabetical order by name. |
spectators |
List of Spectator (see below) objects | A list of all current spectators in the game, sorted in alphabetical order by name. |
Name | Type | Description |
---|---|---|
roleChar |
char | One character that represents the role of the player. H for human, Z for zombie, and S for spectators |
name |
string | Player's name. |
processedScore |
integer | If the player has chosen to share their score publicly, this will be the player's score. Otherwise, a -1 value here means that the score is hidden. |
Name | Type | Description |
---|---|---|
name |
string | Moderator's full name. |
score |
string | This can be any string up to 180 characters long, and is the moderator's made up "score". |
Name | Type | Description |
---|---|---|
name |
string | Spectator's full name |
401
- The user is not logged in.
403
- The user is not a player.
/api/v1/stun_tag/
Reports a stun or a tag, depending on whether the logged in player is a human or a zombie.
POST
None
Name | Type | Description |
---|---|---|
code |
String | Code of player who is getting stunned/tagged |
time |
64 bit Integer | Timestamp in Unix epoch time of the event |
location |
String | Optional. The location, specified as a string. |
description |
String | Optional. A description of the stun or tag. |
200
- Returns the target's full name as a string.
400
- Request was malformed in some way.
403
- User given is not a player. Cannot register stun or tag.
404
- The target is not an active player. Cannot register stun or tag.
409
- An identical stun or tag has been found. The current one is a duplicate.
/api/v1/supply_code/
Reports a stun or a tag, depending on whether the logged in player is a human or a zombie.
POST
None
Name | Type | Description |
---|---|---|
code |
String | Supply code to claim |
200
- Returns the target's full name as a string.
400
- Request was malformed in some way.
401
- Not logged in
403
- User given is not a player or is not human.
404
- The target is not an active player.