API Reference
Keyword
List
Gets the list of all available keywords for the entity.
Example request
curl -X GET \
https://v3-api.fpt.ai/api/v3/keyword/entity_label \
-H 'Authorization: Bearer your_application_token'
Example response
[
{
"code": "m7hu5iywe8sz7n9puleell0kn1dpv4rl",
"entity_code": "vfxpyqk5v9rn49zfcxf74hdra9h6zqx8",
"value": "keyword 1",
"synonym": "[]",
"type": 2
},
{
"code": "s90q14jnvh8hb7fe5xfhdskmmr1emuro",
"entity_code": "vfxpyqk5v9rn49zfcxf74hdra9h6zqx8",
"value": "keyword 2",
"synonym": "[\"syn1\", \"syn2\"]",
"type": 1
}
]
Request
GET https://v3-api.fpt.ai/api/v3/keyword/:entity_label
Parameters
Parameter | Required | Description |
---|---|---|
entity_label | yes | label of the entity |
Response
Returns a list of available keywords for the entity.
Create
Creates a new keyword of the entity with the given parameters.
Example request
curl -X POST \
https://v3-api.fpt.ai/api/v3/keyword/entity_label \
-H 'Authorization: Bearer your_application_token' \
-d '{
"value": "keyword",
"synonym": "[\"synonym\"]"
}'
Example response
{
"code": "lpnakotptlo06bhnz9ttzfgaielxxi7j",
"entity_code": "vfxpyqk5v9rn49zfcxf74hdra9h6zqx8",
"value": "keyword",
"synonym": "[\"synonym\"]",
"type": 2
}
Request
POST https://v3-api.fpt.ai/api/v3/keyword/:entity_label
Parameters
Parameter | Required | Description |
---|---|---|
entity_label | yes | label of the entity |
value | yes | keyword |
synonym | no | list of synonyms for the keyword |
Response
Returns a JSON object represents the created keyword for the entity.
Get
Gets an keyword of entity with the given keyword code.
Example request
curl -X GET \
https://v3-api.fpt.ai/api/v3/keyword/entity_label/lpnakotptlo06bhnz9ttzfgaielxxi7j \
-H 'Authorization: Bearer your_application_token'
Example response
{
"code": "lpnakotptlo06bhnz9ttzfgaielxxi7j",
"entity_code": "vfxpyqk5v9rn49zfcxf74hdra9h6zqx8",
"value": "keyword",
"synonym": "[\"synonym\"]",
"type": 2
}
Request
GET https://v3-api.fpt.ai/api/v3/keyword/:entity_label/:keyword_code
Parameters
Parameter | Required | Description |
---|---|---|
entity_label | yes | label of the entity |
keyword_code | yes | code of the keyword |
Response
Returns a JSON object that represents the keyword.
Delete
Deletes an intent specified by name.
Example request
curl -X DELETE \
https://v3-api.fpt.ai/api/v3/keyword/entity_label/lpnakotptlo06bhnz9ttzfgaielxxi7j \
-H 'Authorization: Bearer your_application_token'
Example response
{
"message": "Deleted"
}
Request
DEL https://v3-api.fpt.ai/api/v3/keyword/:entity_label/:keyword_code
Parameters
Parameter | Required | Description |
---|---|---|
entity_label | yes | label of the entity |
keyword_code | yes | code of the keyword |
Response
Returns a JSON object that represents deleting result.
Force delete
Force an intent specified by name.
Example request
curl -X DELETE \
https://v3-api.fpt.ai/api/v3/keyword/entity_label/lpnakotptlo06bhnz9ttzfgaielxxi7j/force-delete \
-H 'Authorization: Bearer your_application_token'
Example response
{
"message": "Deleted"
}
Request
DEL https://v3-api.fpt.ai/api/v3/keyword/:entity_label/:keyword_code/force-delete
Parameters
Parameter | Required | Description |
---|---|---|
entity_label | yes | label of the entity |
keyword_code | yes | code of the keyword |
Response
Returns a JSON object that represents deleting result.
Update
Updates an keyword specified by its code with the given parameters.
Example request
curl -X PUT \
https://v3-api.fpt.ai/api/v3/keyword/entity_label/lpnakotptlo06bhnz9ttzfgaielxxi7j \
-H 'Authorization: Bearer your_application_token' \
-d '{
"value": "keyword",
"synonym": "[\"synonym\"]"
}'
Example response:
{
"code": "lpnakotptlo06bhnz9ttzfgaielxxi7j",
"entity_code": "vfxpyqk5v9rn49zfcxf74hdra9h6zqx8",
"value": "keyword",
"synonym": "[\"synonym\"]",
"type": 2
}
Request
PUT https://v3-api.fpt.ai/api/v3/keyword/:entity_label/:keyword_code
Parameters
Parameter | Required | Description |
---|---|---|
entity_label | yes | label of the entity |
keyword_code | yes | code of the keyword |
value | yes | value of the keyword |
synonym | yes | list of synonyms for the keyword |
Response
Returns a JSON object that represents the updated keyword.