Skip to main content

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.

Quest

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

Content type
application/json
{
  • "difficulty": 3,
  • "number_of_problems": 20,
  • "problem_topic": "Algorithms",
  • "time_limit": 30,
  • "creator": "get_smart_every_day",
  • "enemy": "Alan Turing",
  • "background": "Tokyo"
}

Response samples

Content type
application/json
{
  • "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

Content type
application/json
{
  • "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

Content type
application/json
{
  • "number_of_problems": 30
}

Response samples

Content type
application/json
{
  • "number_of_problems": 30
}

Remove Quest

Delete an existing quest from the database

path Parameters
quest_id
required
integer

Unique identifier of quest

Responses

Guild

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

Content type
application/json
{
  • "name": "Fairy Tale",
  • "guild_code": 1793
}

Response samples

Content type
application/json
{
  • "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

Content type
application/json
{
  • "guild_id": 55,
  • "name": "Fairy Tale",
  • "guild_code": 1793,
  • "quest_assigned": [
    ],
  • "guild_parties": [
    ]
}

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

Content type
application/json
{
  • "name": "Red Claw"
}

Response samples

Content type
application/json
{
  • "name": "Red Claw"
}

Remove Guild

Delete an existing Guild from the database

path Parameters
guild_id
required
integer

Unique identifier of guild

Responses

User

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.

email
string

An email linked to the user's acount for 2FA.

Responses

Request samples

Content type
application/json
{
  • "user_name": "AppleIanBaum",
  • "password": "password123",
  • "email": "Apple@baum.com"
}

Response samples

Content type
application/json
{
  • "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

Content type
application/json
{
  • "user_id": 12,
  • "username": "AppleIanBaum",
  • "password": "password123",
  • "email": "Apple@baum.com",
  • "guilds_in": [
    ],
  • "quest_made": [
    ]
}

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

Content type
application/json
{
  • "username": "IanAppleBaum"
}

Response samples

Content type
application/json
{
  • "username": "IanAppleBaum"
}

Delete a specific user

Remove a user from the database

path Parameters
user_id
required
string

user id of the user

Responses

Party

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

Content type
application/json
{
  • "name": "Cool_Guys_Only_Party",
  • "party_code": 1234
}

Response samples

Content type
application/json
{
  • "party_id": 12,
  • "name": "Cool_Guys_Only_Party",
  • "party_code": 1234,
  • "quest_assigned": 55,
  • "users_inside": [
    ]
}

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

Content type
application/json
{
  • "party_id": 12,
  • "name": "Cool_Guys_Only_Party",
  • "party_code": 1234,
  • "quest_assigned": 55,
  • "users_inside": [
    ]
}

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

Content type
application/json
{
  • "name": "Very_Cool_Guys_Party"
}

Response samples

Content type
application/json
{
  • "name": "Very_Cool_Guys_Party"
}

Delete a specific party

Remove a party from the database

path Parameters
party_id
required
string

Party ID of the party

Responses

Guild 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

Content type
application/json
{
  • "name": "Cool_Guys_Only_Guild_Party",
  • "guild_party_code": 1234
}

Response samples

Content type
application/json
{
  • "guild_party_id": 12,
  • "name": "Cool_Guys_Only_Guild_Party",
  • "guild_party_code": 1234,
  • "quest_assigned": 55,
  • "users_inside": [
    ]
}

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

Content type
application/json
{
  • "guild_party_id": 12,
  • "name": "Cool_Guys_Only_Guild_Party",
  • "guild_party_code": 1234,
  • "quest_assigned": 55,
  • "users_inside": [
    ]
}

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

Content type
application/json
{
  • "name": "Very_Cool_Guys_Guild_Party"
}

Response samples

Content type
application/json
{
  • "name": "Very_Cool_Guys_Guild_Party"
}

Delete a specific guild party

Remove a guild party from the database

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