API Reference
Intent
List
Gets the list of all available intents for the application.
Example request
curl -X GET \
https://v3-api.fpt.ai/api/v3/intent \
-H 'Authorization: Bearer your_application_token'
Example response
[
{
"code": "4lg0a7rcwikqwc38l32k3x5po79sfg8n",
"app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
"label": "ask_inventory",
"description": "Import",
"created_time": "2018-10-03T04:16:04Z",
"intent_type": 0
},
{
"code": "73z4bzfjh7jzv2th9f0w3f0pm1nhaccp",
"app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
"label": "ask_filter",
"description": "Chức năng filter",
"created_time": "2018-10-03T04:16:04Z",
"intent_type": 0
}
]
Request
GET https://v3-api.fpt.ai/api/v3/intent
Parameters
Parameter | Required | Description |
---|---|---|
n/a | n/a | n/a |
Response
Returns a list of available intents for the application.
Create
Creates a new intent with the given parameters.
Example request
curl -X POST \
https://v3-api.fpt.ai/api/v3/intent \
-H 'Authorization: Bearer your_application_token' \
-d '{
"label":"product_info",
"description":"Product information"
}'
Example response
{
"code": "ppmrtdpcuoxcxd0mg65lg4312pdg3u2e",
"app_code": "ryca8xy0bza17j0f2xiv00ljg8j8gscs",
"label": "product_info",
"description": "Product information",
"created_time": "2018-01-11T16:05:49.2237404+07:00"
}
Request
POST https://v3-api.fpt.ai/api/v3/intent
Parameters
Parameter | Required | Description |
---|---|---|
label | yes | name of the intent, must use a-z0-9_ |
description | yes | description of the intent |
Response
Returns a JSON object represents the created intent.
Get
Gets an intent with the given name.
Example request
curl -X GET \
https://v3-api.fpt.ai/api/v3/intent/product_info \
-H 'Authorization: Bearer your_application_token'
Example response
{
"code": "ppmrtdpcuoxcxd0mg65lg4312pdg3u2e",
"app_code": "ryca8xy0bza17j0f2xiv00ljg8j8gscs",
"label": "product_info",
"description": "Product information",
"created_time": "2018-01-11T09:05:49Z"
}
Request
GET https://v3-api.fpt.ai/api/v3/intent/:intent_label
Parameters
Parameter | Required | Description |
---|---|---|
intent_label | yes | name of the intent |
Response
Returns a JSON object that represents the intent.
Delete
Deletes an intent specified by name.
Example request
curl -X DELETE \
https://v3-api.fpt.ai/api/v3/intent/product_info \
-H 'Authorization: Bearer your_application_token'
Example response
HTTP 200 OK
Request
DEL https://v3-api.fpt.ai/api/v3/intent/:intent_label
Parameters
Parameter | Required | Description |
---|---|---|
intent_label | yes | name of the intent |
Response
Returns HTTP Status 200
if the request succeed.
Update
Updates an intent specified by its name with the given parameters. You can update the description only.
Example request
curl -X PUT \
https://v3-api.fpt.ai/api/v3/intent/product_info \
-H 'Authorization: Bearer your_application_token' \
-d '{
"description":"New Description"
}'
Example response:
{
"code": "ppmrtdpcuoxcxd0mg65lg4312pdg3u2e",
"app_code": "ryca8xy0bza17j0f2xiv00ljg8j8gscs",
"label": "product_info",
"description": "New Description",
"created_time": "2018-01-11T09:05:49Z"
}
Request
PUT https://v3-api.fpt.ai/api/v3/intent/:intent_label
Parameters
Parameter | Required | Description |
---|---|---|
description | yes | new description of the intent |
Response
Returns a JSON object that represents the updated intent.
List samples of intent
List samples of intent.
Example request
curl -X GET \
https://v3-api.fpt.ai/api/v3/intent/{label}/samples \
-H 'Authorization: Bearer your_application_token'
Example response
[
{
"code": "m1iid0dbif63meubpw5v2xn72k8g7hh4",
"app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
"content": "Hi, em có người yêu chưa",
"created_time": "2018-10-03T04:16:11Z",
"intent_label": "chao_hoi",
"intent_type": 0,
"entities": []
},
{
"code": "b7fxxr2sq6ycdrimaxlvcitr6x35tieo",
"app_code": "dfd6908df08cf9d825f9ca9d38bf4677",
"content": "Shop ơi cho em hỏi chút thông tin với",
"created_time": "2018-10-03T04:16:10Z",
"intent_label": "chao_hoi",
"intent_type": 0,
"entities": []
}
]
Request
GET https://v3-api.fpt.ai/api/v3/intent/{label}/samples
Parameters
Parameter | Required | Description |
---|---|---|
label | yes | The label of intent |
Response
Returns a list of samples of intent for the application.
Delete all samples of intent
Delete all samples of intent.
Example request
curl -X DELETE \
https://v3-api.fpt.ai/api/v3/intent/{label}/samples \
-H 'Authorization: Bearer your_application_token'
Example response
{
"message": "Deleted"
}
Request
DELETE https://v3-api.fpt.ai/api/v3/intent/{label}/samples
Parameters
Parameter | Required | Description |
---|---|---|
label | yes | The label of intent |
Response
Returns a message of status of delete request.