Skip to content

API Documentation for Practice App Rock Paper Scissors

harunsami edited this page May 12, 2023 · 3 revisions

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"
    }
]


💻 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