Skip to content

General API Documentation

Can edited this page May 12, 2023 · 2 revisions

API Documentation for Practice App Top Games

Top Games - POST

  • Endpoint: /api/v1/games/topgames
  • Definition: Requests the data for the top 100 games from a third party API and inserts them into the database
  • Query Parameters: None
  • Body Data: userEmail:string (it is required), number:integer (it is required)
  • Example Request Query:
http://localhost:3001/api/v1/games/topgames
  • Example Request Body:
{
    "userEmail":"[email protected]",
    "number":2
}
  • Example Response Body:
{
    "status": "success",
    "message": "Info for top games is inserted into DB successfully"
}

Top Games - GET

  • Endpoint: /api/v1/games/topgames
  • Definition: Returns the top n games that are added to the database for the user with email as userEmail. n is the number of games added to the database by this user in the last post request.
  • Query Parameters: userEmail: string (it is required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body: (There may be up to 100 json objects in the response only two of them is shown in the example)
[
    {
        "user_email": "[email protected]",
        "name": "Dota 2",
        "developer": "Valve",
        "publisher": "Valve",
        "owners": "200,000,000 .. 500,000,000",
        "average_forever": "37272",
        "average_2weeks": "1526",
        "median_forever": "869",
        "median_2weeks": "724",
        "price": "0",
        "initialprice": "0",
        "discount": "0",
        "ccu": "538803",
        "createdAt": "2023-05-11T14:18:31.571Z"
    },
    {
        "user_email": "[email protected]",
        "name": "Counter-Strike: Global Offensive",
        "developer": "Valve, Hidden Path Entertainment",
        "publisher": "Valve",
        "owners": "50,000,000 .. 100,000,000",
        "average_forever": "28762",
        "average_2weeks": "794",
        "median_forever": "5491",
        "median_2weeks": "351",
        "price": "0",
        "initialprice": "0",
        "discount": "0",
        "ccu": "1394846",
        "createdAt": "2023-05-11T14:18:31.571Z"
    }
]

API Documentation for Practice App Yugioh Card

Functionality - POST

  • Endpoint: /api/v1/games/yugiohcard
  • Definition: Requests the data for a Yugioh card from a third party API and inserts them into the database
  • Query Parameters: None
  • Body Data: userEmail:string (it is required) , card_name:string (it is required)
  • Example Request Query:
http://localhost:3001/api/v1/games/yugiohcard
  • Example Request Body:
{
    "card_name" : "Dark Magician" ,
    "userEmail" : "[email protected]"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Yugioh card info is inserted to database successfully"
}

Functionality - GET

  • Endpoint: api/v1/games/yugiohcard
  • Definition: Returns the information about the cards that are added to the database for the user with email as userEmail
  • Query Parameters: userEmail:string(it is required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body:
[
    {
        "card_id": "55144522",
        "card_name": "Pot of Greed",
        "card_type": "Spell Card",
        "user_email": "[email protected]",
        "createdAt": "2023-05-11T18:21:50.002Z"
    },
    {
        "card_id": "89943724",
        "card_name": "Elemental HERO Neos",
        "card_type": "Normal Monster",
        "user_email": "[email protected]",
        "createdAt": "2023-05-11T18:21:36.646Z"
    },
    {
        "card_id": "46986421",
        "card_name": "Dark Magician",
        "card_type": "Normal Monster",
        "user_email": "[email protected]",
        "createdAt": "2023-05-11T18:21:21.411Z"
    }
]

API Documentation for Practice App Card By Name

Card By Name - POST

  • Endpoint: /api/v1/games/card
  • Definition: Request a single card info from a third party Hearthstone API - Single Card and insert relevant (desired) information to database (CardByName schema)
  • Query Parameters: None
  • Body Data: card_name (required): string, userEmail (required): string
  • Example Request Query:
http://localhost:3001/api/v1/games/card
  • Example Request Body:
{
    "card_name":"Screaming Banshee",
    "userEmail":"[email protected]"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Card info is inserted to database successfully"
}

Card By Name - GET

  • Endpoint: /api/v1/games/card
  • Definition: Returns the cards that are added to the database by the user with email as userEmail
  • Query Parameters: userEmail (required): string
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body:
[
    {
        "card_id": "RLK_715",
        "card_name": "Runeforging",
        "card_set": "Core",
        "user_email": "[email protected]",
        "createdAt": "2023-05-12T13:40:38.323Z"
    },
    {
        "card_id": "ETC_533",
        "card_name": "Mosh Pit",
        "card_set": "Festival of Legends",
        "user_email": "[email protected]",
        "createdAt": "2023-05-11T20:13:25.394Z"
    },
    {
        "card_id": "RLK_Prologue_066",
        "card_name": "Hematurge",
        "card_set": "March of the Lich King",
        "user_email": "[email protected]",
        "createdAt": "2023-05-11T20:08:23.165Z"
    },
    {
        "card_id": "ETC_522",
        "card_name": "Screaming Banshee",
        "card_set": "Festival of Legends",
        "user_email": "[email protected]",
        "createdAt": "2023-05-07T16:40:46.154Z"
    },
    {
        "card_id": "RLK_225",
        "card_name": "Blightfang",
        "card_set": "March of the Lich King",
        "user_email": "[email protected]",
        "createdAt": "2023-05-07T16:38:30.265Z"
    },
    {
        "card_id": "RLK_083",
        "card_name": "Deathchiller",
        "card_set": "Path of Arthas",
        "user_email": "[email protected]",
        "createdAt": "2023-05-07T12:02:45.979Z"
    },
    {
        "card_id": "RLK_516",
        "card_name": "Bone Breaker",
        "card_set": "Path of Arthas",
        "user_email": "[email protected]",
        "createdAt": "2023-05-07T11:57:59.138Z"
    }
]

API Documentation for Practice App Games By User

Functionality - POST

  • Endpoint: /api/v1/games/user
  • Definition: Requests the games that user with steamid own from the third party api and adds it to the database after filtering them by their minimum playtime on Windows platform.
  • Query Parameters: None
  • Body Data: userEmail:Text (Required), steamid:Number (Required), minPlaytime:Number (Not Required)
  • Example Request Query:
http://localhost:3001/api/v1/games/user
  • Example Request Body: (some description if the whole body cannot be shown )
{
    "steamid": "76561198310035929",
    "userEmail": "[email protected]",
    "minPlaytime": "30"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Games are inserted to database successfully"
}

Functionality - GET

  • Endpoint: api/v1/games/user
  • Definition: Will get the query results that are requested from the given email.
  • Query Parameters: userEmail:Text (Required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Response Body:
{
    "user_email": "[email protected]",
    "games": [
        {
            "game_id": 105600,
            "playtime": 151,
            "playtime_on_windows": 37,
            "_id": "645d6563dfe43c5276acf07b"
        },
        {
            "game_id": 238960,
            "playtime": 2036,
            "playtime_on_windows": 177,
            "_id": "645d6563dfe43c5276acf07c"
        },
        {
            "game_id": 730,
            "playtime": 1595,
            "playtime_on_windows": 654,
            "_id": "645d6563dfe43c5276acf07d"
        },
        {
            "game_id": 578080,
            "playtime": 125,
            "playtime_on_windows": 125,
            "_id": "645d6563dfe43c5276acf07e"
        }
    ],
    "createdAt": "2023-05-11T22:00:03.969Z"
}

API Documentation for Practice App Game Reviews

Game Reviews - POST

!!!VERY IMPORTANT NOTE!!!
You can only issue 25 requests per day to this endpoint due to the external api restrictions.
  • Endpoint: /api/v1/games/reviews
  • Definition: Requests game review data from an external api
  • Query Parameters: None
  • Body Data:
    • userEmail:string (required)
    • gameNameCriteria: string (required)
    • sort: string (optional)
  • Example Request Query:
http://localhost:3001/api/v1/games/review
  • Example Request Bodies:
{
    "userEmail":"[email protected]",
    "gameNameCriteria": "human fall flat"
}
{
    "userEmail":"[email protected]",
    "gameNameCriteria": "human fall flat"
    "sort": "score-high"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Game reviews for the game Human: Fall Flat are inserted to the database successfully"
}
  • !!! Erroneous Request Bodies:
{
    "gameNameCriteria": "human fall flat"
}
{
    "userEmail":"[email protected]"
}
  • !!! Error Response:
{
    "id": 4,
    "status": "Error",
    "message": "You should provide all the necessary fields"
}

Game Reviews - GET

  • Endpoint: /api/v1/games/review
  • Definition: Returns the game reviews that are added to the database for the user with email userEmail
  • Query Parameters: userEmail: string (required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body: (All game review requests that user have issued so far is returned)
[
    {
        "user_email": "[email protected]",
        "game_name": "Human: Fall Flat",
        "game_id": 2906,
        "reviews": [
            {
                "review_text": "Human: Fall Flat’s slapstick controls and ridiculous animation do a great job of making repeated, frustrating, and unfair failure at physics puzzles seem fun for a while. And when that fun runs out, you can extend it by bringing in a friend and drawing silly things on your goofball character. If you don’t play it, watch someone play it.",
                "publish_date": "2016-07-28T04:00:00.000Z"
            },
            {
                "review_text": "An abrupt ending that doesn't have much of a climax and some moments of fist-clenching frustration keep Human: Fall Flat from the upper echelons of puzzle gaming, but it's still something I plan on going back to with friends. Plus, it lets you draw on your character, leading to the butt you see in all of the screenshots. Apparently, I wasn't the only one who thought this was hilarious. This one was for you, Laura!",
                "publish_date": "2016-08-06T04:00:00.000Z",
            },
            {
                "review_text": "Human Fall Flat is a game that’s aware of how unusual it is and builds to its own strengths. Bob’s ungainly controls work particularly well in the invitingly designed worlds that let you play around, cheat and conspire with a co-op buddy.",
                "publish_date": "2016-07-27T04:00:00.000Z",
            }
       ],
       "createdAt": {
          "$date": "2023-05-07T22:14:54.465Z"
       }
    },
    {
        "user_email": "[email protected]",
        "game_name": "Human: Fall Flat",
        "game_id": 2906,
        "reviews": [
            {
                "review_text": "All told, this is yet another excellent port of Minecraft, nothing more and nothing less. With that being said, we would strongly recommend that you pick up this version, as the versatile setup of the Switch allows this to be the most easily accessible and playable Minecraft to date. That convenience factor is the only real notable difference, however, so it’s up to you whether that justifies paying for another version of Minecraft. If you want to play the best portable version of the game, however, look no further",
                "publish_date": "2017-05-11T00:00:00.000Z"
            },
            {
                "review_text": "It looks good, plays well and hits all the classic Minecraft buttons, but with the bonus that your Minecraft addiction is a little easier to fit in with normal life. Throw in some of the best themed Minecraft content around and you have a must-have for Switch gamers, albeit not the absolutely best version of the game.",
                "publish_date": "2017-05-15T00:00:00.000Z",
            },
            {
                "review_text": "A revolutionary game developed on a brilliant idea, Minecraft is a sandbox made on exploration and construction, a fresh and rewarding experience for every kind of gamer.",
                "publish_date": "2011-11-25T00:00:00.000Z",
            }
       ],
       "createdAt": {
          "$date": "2023-05-06T22:14:54.465Z"
       }
    }
]
  • !!! Erroneous Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • !!! Error Response:
{
    "id": 1,
    "status": "Error",
    "message": "There is no game that you've searched for its reviews before"
}

API Documentation for Practice App Games By Genre

Games By Genre - POST

  • Endpoint: /api/v1/games/genre
  • Definition: Requests the data for the specific genre from a third party API and inserts them into the database
  • Query Parameters: None
  • Body Data: userEmail:string (it is required) , genre_ID:number (it is required)
  • Example Request Query:
http://localhost:3001/api/v1/games/genre
  • Example Request Body:
{
    "genre_ID":4
    "userEmail":"[email protected]"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Games by genre info is inserted into DB successfully"
}

Games By Genre - GET

  • Endpoint: /api/v1/games/genre
  • Definition: Returns information about the genres that are added to the database for the user with email as userEmail
  • Query Parameters: userEmail: string (it is required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body:
[
    {
    "genre_id": 4
    "genre_name": "Action"
    "games_count": 172448
    "image_background": "https://media.rawg.io/media/games/7cf/7cfc9220b401b7a300e409e539c9afd5.jpg"
    "game_description": "The action game is a genre that includes fights, puzzles, and strategies emphasizing coordination and reaction. It includes a large variety of sub-genres like fighting, beat 'em ups, shooters, survivals, mazes, and platforms; sometimes even multiplayer online battles and real-time strategies. Usually, the player performs as the protagonist with its unique abilities; some games add power-ups along the way. The character aims to complete levels, collect items, avoid obstacles, and battle against antagonists. It's necessary to avoid severe injuries during fights; if the health bar goes low, the player loses. Some games have an unbeatable number of enemies, and the only goal is to maximize score and survive for as long as possible. There might be a boss enemy who appears at the last level; he has unique abilities and a longer health bar. Pong is one of the first action games, released in 1972; the latest include Battlefield, Assasin's Creed, Fortnite and Dark Souls."
    "user_email": "a@a"
    }
]

API Documentation for Practice App Game By Category

Game By Category - POST

  • Endpoint: /api/v1/games/category
  • Definition: Requests the data for the games from a third party API based on the given category and inserts them into the database
  • Query Parameters: None
  • Body Data: userEmail:string (it is required), category:string(it is required)
  • Example Request Query:
http://localhost:3001/api/v1/games/category
  • Example Request Body:
{
    "category":"superhero",
    "userEmail":"[email protected]"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Games are inserted to database successfully"
}

Game By Category - GET

  • Endpoint: /api/v1/games/category
  • Definition: Returns the games that are added to the database for the user with email as userEmail
  • Query Parameters: userEmail: string (it is required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body: (There are 100 json objects in the response only two of them is shown in the example)
[
    {
        "user_email": "[email protected]",
        "category": "superhero",
        "games": [
            {
                "game_id": 525,
                "name": "MultiVersus",
                "short_description": "The Warner Bros lineup meets Smash in Player First Games’ MultiVersus.",
                "platform": "PC (Windows)",
                "publisher": "Warner Bros. Games",
                "developer": "Player First Games",
                "release_date": "2022-07-19",
                "_id": "645e161dd8d8b9a3c1ce5929"
            },
            {
                "game_id": 541,
                "name": "Marvel Snap",
                "short_description": "A fast paced strategy card game set in the Marvel universe.",
                "platform": "PC (Windows)",
                "publisher": "Nuverse",
                "developer": "Second Dinner Studios, Inc.",
                "release_date": "2022-10-18",
                "_id": "645e161dd8d8b9a3c1ce592a"
            },
            {
                "game_id": 453,
                "name": "Gotham City Impostors",
                "short_description": "A free to play multiplayer FPS that pits vigilantes dressed up like Batman against criminals dressed up like the Joker",
                "platform": "PC (Windows)",
                "publisher": "Warner Bros. Interactive Entertainment",
                "developer": "Monolith Productions, Inc.",
                "release_date": "2012-08-31",
                "_id": "645e161dd8d8b9a3c1ce592b"
            },
            {
                "game_id": 260,
                "name": "DC Universe Online",
                "short_description": "A free-to-play, comics based MMORPG set in the popular DC Comics universe.",
                "platform": "PC (Windows)",
                "publisher": "Daybreak Games",
                "developer": "Daybreak Games",
                "release_date": "2011-01-11",
                "_id": "645e161dd8d8b9a3c1ce592c"
            },
            {
                "game_id": 288,
                "name": "Champions Online",
                "short_description": "A superhero MMORPG created by the same studio behind City of Heroes.",
                "platform": "PC (Windows)",
                "publisher": "Perfect World Entertainment",
                "developer": "Cryptic Studios",
                "release_date": "2009-09-01",
                "_id": "645e161dd8d8b9a3c1ce592d"
            },
            {
                "game_id": 430,
                "name": "Urban Rivals",
                "short_description": "A free to play browser based card-game with a high player base and comic-book inspired world!",
                "platform": "Web Browser",
                "publisher": "Boostr ",
                "developer": "Acute Mobile",
                "release_date": "2006-01-17",
                "_id": "645e161dd8d8b9a3c1ce592e"
            }
        ],
        "createdAt": "2023-05-12T10:34:05.643Z"
    }
]

API Documentation for Practice App Game Suggestions

Game Suggestions - POST

  • Endpoint: /api/v1/games/suggestion
  • Definition: Fetchs five different game suggestions using ChatGPT based on the input prompt and inserts into the database
  • Query Parameters: None
  • Body Data:
    • userEmail:string (required)
    • enjoyedGames: string (required)
    • preferredGameType: string (required)
  • Example Request Query:
http://localhost:3001/api/v1/games/suggestion
  • Example Request Body:
{
    "userEmail":"[email protected]",
    "preferredGameType": "Action",
    "enjoyedGames": "Counter Strike 1.6 and Metin 2"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Game suggestion is inserted to database successfully"
}

Game Suggestions - GET

  • Endpoint: api/v1/games/suggestion
  • Definition: Returns the game suggestions that are added to the database for the user with email userEmail
  • Query Parameters: userEmail: string (required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body: (Game suggestions that have been generated for that user email)
[
  {
    "_id": "645e3d9ed714970cbba7d2b9",
    "enjoyed_games": "Fall guys",
    "preferred_game_type": "Platformer",
    "ai_suggestion": "Based on your preference for platformer games and enjoyment of Fall Guys, here are five game recommendations:\n\n1. Super Mario Odyssey - a popular and fun platformer game on the Nintendo Switch.\n2. Ori and the Will of the Wisps - a visually stunning and challenging platformer game available on multiple platforms.\n3. Celeste - a critically acclaimed and highly awarded platformer game with a touching story and beautiful design.\n4. Hollow Knight - a challenging and atmospheric platformer game with a deep and immersive world to explore.\n5. Rayman Legends - a colorful and engaging platformer game with a great emphasis on co-op and multiplayer gameplay.",
    "createdAt": "2023-05-12T13:22:38.603Z"
  },
  {
    "_id": "645e3ce9d714970cbba7d2b4",
    "enjoyed_games": "Counter Strike 1.6 and Metin 2",
    "preferred_game_type": "Action-Adventure",
    "ai_suggestion": "Based on the information provided, some game recommendations for Action-Adventure games could be:\n\n1. Assassin's Creed series\n2. Tomb Raider series\n3. Uncharted series\n4. Batman: Arkham series\n5. Prince of Persia series",
    "createdAt": "2023-05-12T13:19:37.297Z"
  }
]

API Documentation for Practice App Esport Tournaments

Esport Tournaments - POST

  • Endpoint: /api/v1/games/tournaments
  • Definition: Requests the data for the esport tournaments from a third party API and inserts them into the database.
  • Query Parameters: None
  • Body Data: userEmail:string (required)
  • Example Request Query:
http://localhost:3001/api/v1/games/tournaments
  • Example Request Body:
{
    "userEmail":"[email protected]"
}
  • Example Response Body:
{
    "status": "success",
    "message": "tournaments for esports are inserted to database successfully"
}

Esport Tournaments - GET

  • Endpoint: /api/v1/games/tournaments
  • Definition: Returns the esport tournaments that are added to the database for the user with email as userEmail
  • Query Parameters: userEmail: string (required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body:
[
    {
        "user_email": "[email protected]",
        "id": 1570,
        "name": "Dota 2",
        "flag": "dota-2",
        "createdAt": "2023-05-12T13:21:58.550Z"
    },
    {
        "user_email": "[email protected]",
        "id": 1572,
        "name": "CS:GO",
        "flag": "csgo",
        "createdAt": "2023-05-12T13:21:58.550Z"
    },
]

API Documentation for Practice App Achievement By Game Id

Achievement by Game Id - POST

  • Endpoint: /api/v1/games/achievement
  • Definition: Requests the data for the achievements from a third party API based on the given game id. After, it selects the least completed 3 achievements of the game after getting the data. It also finds the name of the game according to game id, which is not defined at third party api. Then, posts the least completed 3 achievements and the name of the game to the data base
  • Query Parameters: None
  • Body Data: userEmail:string (it is required), gameid:string(it is required)
  • Example Request Query:
http://localhost:3001/api/v1/games/achievement
  • Example Request Body:
{
    "userEmail": "[email protected]",
    "gameid": "400"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Least completed achievements are inserted to database successfully"
}

Achievement by Game Id - GET

  • Endpoint: /api/v1/games/achievement
  • Definition: Returns the least completed achievements and game names that are added to the database for the user with email as userEmail
  • Query Parameters: userEmail: string (it is required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body:
[
    {
        "achievement_1": {
            "name": "ACHIEVEMENT_ALL",
            "success_rate": 5.099999904632568
        },
        "achievement_2": {
            "name": "ACHIEVEMENT_24",
            "success_rate": 6.900000095367432
        },
        "achievement_3": {
            "name": "ACHIEVEMENT_25",
            "success_rate": 6.900000095367432
        },
        "game_id": 1593500,
        "user_email": "[email protected]",
        "game_name": "God of War",
        "createdAt": "2023-05-12T14:07:47.127Z"
    },
    {
        "achievement_1": {
            "name": "GUN_GAME_ROUNDS_HIGH",
            "success_rate": 1.7000000476837158
        },
        "achievement_2": {
            "name": "WIN_GUN_GAME_ROUNDS_EXTREME",
            "success_rate": 1.7000000476837158
        },
        "achievement_3": {
            "name": "WIN_GUN_GAME_ROUNDS_ULTIMATE",
            "success_rate": 1.7000000476837158
        },
        "game_id": 730,
        "user_email": "[email protected]",
        "game_name": "Counter-Strike: Global Offensive",
        "createdAt": "2023-05-12T14:07:33.727Z"
    },
    {
        "achievement_1": {
            "name": "DOD_ALL_PACK_1",
            "success_rate": 2.4000000953674316
        },
        "achievement_2": {
            "name": "DOD_BOMBS_DEFUSED_GRIND",
            "success_rate": 2.799999952316284
        },
        "achievement_3": {
            "name": "DOD_WEAPON_MASTERY",
            "success_rate": 3
        },
        "game_id": 300,
        "user_email": "[email protected]",
        "game_name": "Day of Defeat: Source",
        "createdAt": "2023-05-12T14:07:27.603Z"
    },
    {
        "achievement_1": {
            "name": "PORTAL_GET_ALLBRONZE",
            "success_rate": 2.299999952316284
        },
        "achievement_2": {
            "name": "PORTAL_GET_ALLSILVER",
            "success_rate": 2.299999952316284
        },
        "achievement_3": {
            "name": "PORTAL_GET_ALLGOLD",
            "success_rate": 2.299999952316284
        },
        "game_id": 400,
        "user_email": "[email protected]",
        "game_name": "Portal",
        "createdAt": "2023-05-12T14:06:47.590Z"
    }
]

API Documentation for Practice App Rock Paper Scissors

Games By Genre - POST

  • Endpoint: /api/v1/games/choice
  • Definition: Requests the data for a Rock Paper Scissors game choice from a third party API and inserts them into the database
  • Query Parameters: None
  • Body Data: userEmail:string (it is required) , choice:string (it is required)
  • Example Request Query:
http://localhost:3001/api/v1/games/choice
  • Example Request Body:
{
    "choice":"paper"
    "userEmail":"[email protected]"
}
  • Example Response Body:
{
    "status": "success",
    "message": "Game info is inserted to database successfully"
}

Games By Genre - GET

  • Endpoint: /api/v1/games/choice
  • Definition: Returns information about the Rock Paper Scissors games that are added to the database for the user with email as userEmail
  • Query Parameters: userEmail: string (it is required)
  • Body Data: None
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body: None
  • Example Response Body:
[
    {
    "user_email": "a@a"
    "user_choice": "scissors"
    "user_beats": "paper"
    "ai_choice": "paper"
    "ai_beats": "rock"
    "result": "You win"
    }
]

API Documentation for Practice App Game By Deal

Functionality - POST

  • Endpoint: /api/v1/games/deal
  • Definition: This endpoint is designed to enable the retrieval of games available on the Steam Store based on user-defined parameters, with results sorted by price. Additionally, the request and corresponding response are saved to a database for future reference. This functionality promotes data accessibility and enhances record-keeping processes.
  • Body Data:
    • userEmail: String *Required"
    • upperPrice: Number
    • title: String
    • dealCount: Number
    • minimumRating: Number
    • onSale: Boolean Default False
  • Example Request Query:
http://localhost:3001/api/v1/games/deal
  • Example Request Body:
{
    "userEmail": "[email protected]",
    "upperPrice": 10,
    "title": "Warrior",
    "dealCount": 1,
    "minimumRating": 50,
    "onSale": true
}
  • Example Response Body:
{
    "status": "success",
    "message": "History is inserted to database successfully"
}

Functionality - GET

  • Endpoint: api/v1/games/deal
  • Definition: This GET endpoint efficiently retrieves a user's request history from the database, presenting the most recent requests first. By drawing on stored data, this feature supports seamless record-keeping and enhances user browsing capabilities.
  • Query Parameters:
    • userEmail: String Required
  • Example Request Query:
http://localhost:3001/api/v1/games/[email protected]
  • Example Request Body:
{
}
  • Example Response Body:
{
    "user_email": "[email protected]",
    "title": "al",
    "upper_price": 5,
    "deals": [
      {
        "title": "Making History: The Calm and the Storm",
        "sale_price": "0.49",
        "normal_price": "4.99",
        "steam_rating_text": "Mostly Positive",
        "rating": "50%",
        "is_on_sale": true,

      }
    ]
}


💻 Meeting Notes

Cmpe 352
Cmpe 451

📝 Requirements


🪧 Diagrams


📬 Deliverables

Cmpe 352
Cmpe 451

🎇 General Contributions

Cmpe 352 Contributions

Milestone 1
Final Milestone

Cmpe 451 Contributions

Milestone 1
Milestone 2
Final Milestone

📕 Mock Up


🕵️ User Scenario



📝 RAM


📚 Research


📑 Templates


📱 Practice App

API Documentation for Practice App
Clone this wiki locally