Create a new word in the database.

POST /words

Create a new word in the database manually.

application/json

Body Required

The word to be created, based on the following example

  • en string
  • en_type string
  • vn string
  • vn_type string

Responses

  • 201 application/json

    Created

    Hide response attribute Show response attribute object
    • id integer
  • 400

    The request is not following the convention.

  • 403

    The user is not authorized to create a new word (aka. not admin).

  • 500

    The word is already in the database.

POST /words
curl \
 -X POST http://localhost:5000/words \
 --cookie "fastapiusersauth=$API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"en":"Software Construction","en_type":"n","vn":"Xây dựng phần mềm","vn_type":"danh từ"}'
Request example
{
  "en": "Software Construction",
  "en_type": "n",
  "vn": "Xây dựng phần mềm",
  "vn_type": "danh từ"
}
Response examples (201)
{
  "id": 1337
}