Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

REST API Document

Donghyun edited this page Sep 17, 2021 · 5 revisions

REST API Documentation

  • This documentation specifies what the REST API end points.
  • Frontend will make requests to these end points to receive necessary responses.
  • Server will provide middlewares to handle requests and send responses for these endpoints.

Data Structure

The frontend will follow these data structures when communicating with the server

Game

Data format for "game"

{
    rounds, [round]
    isFirstAttempt, (Boolean)
}

Round

Data format for "round"

{
    roundNum, (Number)
    backgroundId, (String)
    timeTaken, (Number)
    isFound, (Boolean)
}

Email

Data format for "email"

{
    email, (String)
}

End Points

Game Data

Send game result to the server

Method Endpoint
POST /game

REQUEST BODY

{
    game,
}

REQUEST BODY EXAMPLE

{
    rounds: [round, round, ...],
    isFirstAttempt: true,
}

RESPONSE (If successful)

201

Email (Subscription)

Save user email so that the user can be notified the outcome of the research

Method Endpoint
POST /email

REQUEST BODY

{
    email,
}

REQUEST BODY EXAMPLE

{
    email: "user123@example.com",
}

RESPONSE (If successful)

201

Clone this wiki locally