API Reference
Dictionary
Get list of dictionaries
Requests FPT.AI the list of dictionaries.
Example request
curl -X GET \
  https://v3-api.fpt.ai/api/v3/dictionary
  -H 'Authorization: Bearer your_application_token'
Example response
[
    {
        "code": "wnz56qw6exaytelvqtvw85tq39pm7njc",
        "word": "coffe",
        "meaning": "[\"cofe\",\"cà phê\", \"cà fe\"]"
    },
    {
        "code": "xyw9zvnwoolfya400tkg2mmwcoe083lg",
        "word": "thu nhập cá nhân",
        "meaning": "tncn"
    }
]
Request
GET https://v3-api.fpt.ai/api/v3/dictionary
Parameters
| Parameter | Required | Description | 
|---|---|---|
| n/a | n/a | n/a | 
Response
Returns a JSON contain list of dictionaries.
Create
Create a dictionary.
Example request
curl -X POST \
  https://v3-api.fpt.ai/api/v3/dictionary \
  -H 'Authorization: Bearer your_application_token' \
  -d '{
    "word": "coffe",
    "meaning": "[\"cofe\",\"cà phê\", \"cà fe\"]"
}'
Example response
{
    "code": "l2i1ylfx9zo40q3n2vvoswzlcm9y3zc2",
    "word": "coffe",
    "meaning": "[\"cofe\",\"cà phê\", \"cà fe\"]"
}
Request
POST https://v3-api.fpt.ai/api/v3/dictionary
Paramenters
| Parameter | Required | Description | 
|---|---|---|
| word | yes | The key word of dictionary | 
| meaning | no | Desciption of the key word | 
Response
Returns a JSON object that contains information of one elememt in dictionary.
Update
Update a dictionary.
Example request
curl -X PUT \
  https://v3-api.fpt.ai/api/v3/dictionary/l2i1ylfx9zo40q3n2vvoswzlcm9y3zc2 \
  -H 'Authorization: Bearer your_application_token' \
  -d '{
    "word": "coffe",
    "meaning": "[\"cofe\",\"cofee\",\"cà phê\", \"cà fe\"]"
}'
Example response
{
    "message": "Updated"
}
Request
POST https://v3-api.fpt.ai/api/v3/dictionary/{word_code}
Paramenters
| Parameter | Required | Description | 
|---|---|---|
| word | yes | The key word of dictionary | 
| meaning | no | Desciption of the key word | 
Response
Returns a JSON object that contain message of result.
Delete
Delete a dictionary.
Example request
curl -X DELETE \
  https://v3-api.fpt.ai/api/v3/dictionary/l2i1ylfx9zo40q3n2vvoswzlcm9y3zc2  \
  -H 'Authorization: Bearer your_application_token' \
Example response
{
    "message": "Deleted"
}
Request
DELETE https://v3-api.fpt.ai/api/v3/dictionary/{word_code}
Paramenters
| Parameter | Required | Description | 
|---|---|---|
| n/a | n/a | n/a | 
Response
Returns a JSON object that contain message of result.
