API 1 - Devs and Dragons
Devs and Dragons - OpenAPI 3.0 (1.0.11)
Download OpenAPI specification:Download
Pre-conditions for POST, GET, PATCH, and DELETE REST API calls which are used by the methods of our classes.
POST: An authentication header with the authentication token. A content type header set to application/json
for a JSON request block. A request body with with a JSON block that specifies values for all data fields (attributes) of the object to be created.
GET: Appropriate endpoint.
PATCH: An authentication header with the authentication token. A content type header set to application/json
for a JSON request block. A request body with a JSON block that only specifies the data fields intended be changed with new values for the object. Appropriate endpoint.
DELETE: Appropriate endpoint.
Represents the main action users are pursuing. It is the unit of learning that users must do (aka play) and finish to move forward in the game which affects all the other game and user function. The main core function of Devs and Dragons.
Create Quest
Creates a new quest in the database
Request Body schema: application/json
difficulty | integer Measured rigor of quest |
number_of_problems | integer Total questions in quest |
problem_topic | string Topic of quest |
time_limit | number Total time limit for players finishing quest |
creator | string User who created quest |
enemy | string Quest's villain challenging players with problems |
background | string Wallpaper of quest |
Responses
Request samples
- Payload
{- "difficulty": 3,
- "number_of_problems": 20,
- "problem_topic": "Algorithms",
- "time_limit": 30,
- "creator": "get_smart_every_day",
- "enemy": "Alan Turing",
- "background": "Tokyo"
}
Response samples
- 200
{- "quest_id": 45,
- "difficulty": 3,
- "number_of_problems": 20,
- "problem_topic": "Algorithms",
- "time_limit": 30,
- "creator": "get_smart_every_day",
- "enemy": "Alan Turing",
- "background": "Tokyo"
}
Retrieve Quest data
Returns JSON file with quest_id
, difficulty
, number_of_problems
, problem_topic
, time_limit
, creator
, enemy
, background
; all the data fields of the Quest class
path Parameters
quest_id required | integer Unique identifier of quest |
Responses
Response samples
- 200
{- "quest_id": 45,
- "difficulty": 3,
- "number_of_problems": 20,
- "problem_topic": "Algorithms",
- "time_limit": 30,
- "creator": "get_smart_every_day",
- "enemy": "Alan Turing",
- "background": "Tokyo"
}
Update Quest Data
Modifies quest data with only the data field needed to be changed for quest
path Parameters
quest_id required | integer Unique identifier of quest |
Request Body schema: application/json
number_of_problems | integer Total questions in quest |
Responses
Request samples
- Payload
{- "number_of_problems": 30
}
Response samples
- 200
{- "number_of_problems": 30
}
The guild class is responsible for managing guild-related data and functionality of the platform. It allows users to create, join and manage guilds and track information such as current guild members and assigned quests. The class provides functionality for instructors and students.
Create Guild
Create a new guild in the database for users to join via an unique code
Request Body schema: application/json
name | string Stores the name of the guild to help users identify their guilds |
guild_code | integer A code used for users to join a guild. It acts as an invite mechanism, allowing users to connect to new or existing guilds |
Responses
Request samples
- Payload
{- "name": "Fairy Tale",
- "guild_code": 1793
}
Response samples
- 200
{- "guild_id": 55,
- "name": "Fairy Tale",
- "guild_code": 1793,
- "quest_assigned": null,
- "guild_parties": null
}
Retrieve Guild data
Returns JSON file with guild_id
, name
, description
, guild_code
, quest_assigned
, guild_parties
; all the data fields of the Guild class
path Parameters
guild_id required | integer Unique identifier of guild |
Responses
Response samples
- 200
{- "guild_id": 55,
- "name": "Fairy Tale",
- "guild_code": 1793,
- "quest_assigned": [
- "assigned_quest1",
- "assigned_quest2",
- "assigned_quest3"
], - "guild_parties": [
- "guild_party1",
- "guild_party2",
- "guild_party3"
]
}
Update Guild Data
Modifies guild data with only the data field needed to be changed for guild
path Parameters
guild_id required | integer Unique identifier of guild |
Request Body schema: application/json
name | string Stores the name of the guild to help users identify their guilds |
Responses
Request samples
- Payload
{- "name": "Red Claw"
}
Response samples
- 200
{- "name": "Red Claw"
}
The user class will be used to determine what quest a specific user has made, what guilds and parties a specific user has joined. The class will also be used in authenticating a user account login and deletion.
Create User
Create new user in the database
Request Body schema: application/json
user_name | string The desired name of the user. |
password | string The desired password of the user. |
string An email linked to the user's acount for 2FA. |
Responses
Request samples
- Payload
{- "user_name": "AppleIanBaum",
- "password": "password123",
- "email": "Apple@baum.com"
}
Response samples
- 200
{- "user_id": 12,
- "user_name": "AppleIanBaum",
- "password": "password123",
- "email": "Apple@IanBaum.com",
- "guilds_in": null,
- "quest_made": null
}
Get data of a specific user data
Retrieve data of a specific user
path Parameters
user_id required | integer User ID of the user |
Responses
Response samples
- 200
{- "user_id": 12,
- "username": "AppleIanBaum",
- "password": "password123",
- "email": "Apple@baum.com",
- "guilds_in": [
- "guild1",
- "guild2"
], - "quest_made": [
- "quest1",
- "quest2",
- "quest2"
]
}
Update User Data
Modifies user data with only the data field needed to be changed for user
path Parameters
user_id required | integer User ID of the user |
Request Body schema: application/json
username | string Changed username |
Responses
Request samples
- Payload
{- "username": "IanAppleBaum"
}
Response samples
- 200
{- "username": "IanAppleBaum"
}
The party class will be used to create and join a party. It will be used to start quests by assiging one specific quest to the party using the Quest ID. The class will be used one last time to delete the party when the party is done with the quest.
Create Party
Create new party in the database
Request Body schema: application/json
name | string The desired name of the party. |
party_code | integer The join code required to join the party. |
Responses
Request samples
- Payload
{- "name": "Cool_Guys_Only_Party",
- "party_code": 1234
}
Response samples
- 200
{- "party_id": 12,
- "name": "Cool_Guys_Only_Party",
- "party_code": 1234,
- "quest_assigned": 55,
- "users_inside": [
- "AwsomeGuyJericho"
]
}
Get data of a specific party
Retrieve data of a specific party
path Parameters
party_id required | integer Party ID of the party |
Responses
Response samples
- 200
{- "party_id": 12,
- "name": "Cool_Guys_Only_Party",
- "party_code": 1234,
- "quest_assigned": 55,
- "users_inside": [
- "AwsomeGuyJericho"
]
}
Update Party Data
Modifies party data with only the data field needed to be changed for user
path Parameters
party_id required | integer Party ID of the party |
Request Body schema: application/json
name | string The desired name of the party. |
Responses
Request samples
- Payload
{- "name": "Very_Cool_Guys_Party"
}
Response samples
- 200
{- "name": "Very_Cool_Guys_Party"
}
The guild party class will be used to create and join a guild party within a guild. It will be used to start quests that are assigned to the guild.
Create Guild Party
Create new guild party in the database
path Parameters
guild_id required | integer Guild ID of the guild the guild party is created. |
Request Body schema: application/json
name | string The desired name of the guild party. |
guild_party_code | integer The join code required to join the guild party. |
Responses
Request samples
- Payload
{- "name": "Cool_Guys_Only_Guild_Party",
- "guild_party_code": 1234
}
Response samples
- 200
{- "guild_party_id": 12,
- "name": "Cool_Guys_Only_Guild_Party",
- "guild_party_code": 1234,
- "quest_assigned": 55,
- "users_inside": [
- "AwsomeGuyJericho"
]
}
Get data of a specific guild party
Retrieve data of a specific guild party
path Parameters
guild_id required | integer Guild ID of the guild the guild party is created. |
guild_party_id required | integer Guild Party ID of the party . |
Responses
Response samples
- 200
{- "guild_party_id": 12,
- "name": "Cool_Guys_Only_Guild_Party",
- "guild_party_code": 1234,
- "quest_assigned": 55,
- "users_inside": [
- "AwsomeGuyJericho"
]
}
Update Guild Party Data
Modifies guild party data with only the data field needed to be changed for user
path Parameters
guild_id required | integer Guild ID of the guild the guild party is created. |
guild_party_id required | integer Guild Party ID of the party. |
Request Body schema: application/json
name | string The desired name of the guild party. |
Responses
Request samples
- Payload
{- "name": "Very_Cool_Guys_Guild_Party"
}
Response samples
- 200
{- "name": "Very_Cool_Guys_Guild_Party"
}