Update a word in the database.

PUT /words

Update a word in the database manually.

application/json

Body Required

The description of the word to be updated. Except the id, all other fields are optional.

If the field is provided, it will be overwritten with the data in the dictionary. However, if the field is not provided, the old data will not be changed.

  • id integer
  • en string
  • en_type string
  • vn string
  • vn_type string

Responses

  • 200

    OK

  • 400

    The request is not following the convention.

  • 403

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

  • 404

    The word id's is not found.

  • 500

    Unknown error.

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