Skip to content

API Documentation for Practice App Achievement By Game Id

Ali Başaran edited this page May 12, 2023 · 3 revisions

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://ec2-16-16-200-79.eu-north-1.compute.amazonaws.com: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://ec2-16-16-200-79.eu-north-1.compute.amazonaws.com:3001/api/v1/games/achievement/[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"
    }
]


💻 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