Skip to content

Language Word Endpoints

dionisggr edited this page Feb 27, 2021 · 1 revision

Get Language Words

URL: /api/language
Method: GET
Auth required: Yes

  • Bearer <JSON Web Token>

Request Body

Requires headers: {'Content-Type': 'application/json'}

Success Reponse

Code: 200 OK
Content example

{
  "nextWord": "casa",
  "totalScore": 2,
  "wordCorrectCount": 0,
  "wordIncorrectCount": 0,
  "answer: "house",
  isCorrect: true,
}

Get Next Word

URL: /api/language/head
Method: GET
Auth required: Yes

  • Bearer <JSON Web Token>

Request Body

Requires headers: {'Content-Type': 'application/json'}

Success Reponse

Code: 200 OK
Content example

{
  "nextWord": "casa",
  "totalScore": 2,
  "wordCorrectCount": 0,
  "wordIncorrectCount": 0,
  "answer: "house",
  isCorrect: true,
}

Guess/Answer Feedback

URL: /api/language/guess
Method: POST
Auth required: Yes

  • Bearer <JSON Web Token>

Request Body

Requires headers: {'Content-Type': 'application/json'}

{
  "name": "Dwight Schrute"
  "username": "dwight",
  "password": "pass"
}
Name Type In Description
nextWord text header Next word after guess
totalScore integer header Score among all words guess
wordCorrectCount integer header Word correct answer score
wordIncorrectCount integer header Word incorrect answer score
answer text header Correct answer
isCorrect boolean header Feedback for previous guess

Success Reponse

Code: 200 OK
Content example

{
  "nextWord": "casa",
  "totalScore": 2,
  "wordCorrectCount": 0,
  "wordIncorrectCount": 0,
  "answer: "house",
  isCorrect: true,
}