Training
It’s challenging to predict all the queries coming to the chatbot every day. People communicate in different styles, using different words and phrases. Stop guessing what your clients are going to say and start listening and using the data you have to train your bot.
List all phrases
Returns a list of all umatched phrases available to train.
Request URL
curl --request GET \
--url https://api.chatbot.com/training \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'
Response example
{
"items": [
{
"id": "62b2fe51d12339bc80441824",
"storyId": "62b212339826a321207255215",
"date": "2022-06-22T11:34:41.609Z",
"text": "how are you?",
"unmatched": 1
},
{
"id": "629dea422314679bc80cd1d37",
"storyId": "6292341c19dbee00074cec67",
"date": "2022-06-06T11:52:32.831Z",
"text": "how to place order",
"unmatched": 2
},
{
"id": "629d12442334679bc80cae3f1",
"storyId": "629de3221c19dbee00074cec67",
"date": "2022-06-06T11:50:51.700Z",
"text": "refund order",
"unmatched": 5
}
]
}
Train phrases
Trains the bot with the selected phrase(s). The phrase(s) is added to the User Input with the provided interaction ID.
Request URL
curl --request PUT \
--url 'https://api.chatbot.com/training/train' \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
"storyId":"<Story ID>",
"targetId":"<User Input ID>",
"items":["<Phrase ID>", "<2nd Phrase ID>"]
}'
Parameters
Parameter | Type | Description |
---|---|---|
storyId |
Alphanumeric | required Story ID |
targetId |
Alphanumeric | required User Input interaction ID |
items |
Array[Phrase ID] | required List of phrase(s) IDs |
Response example
{
"used": [
"629dea7c213s4679bc80cd1d37"
],
"unused": [],
"timestamp": "2022-06-29T13:52:59.900Z",
"status": {
"code": 200,
"type": "success"
}
}
Train with custom text
Trains the bot with the custom text provided in the API request. The phrase(s) is added to the User Input with the provided interaction ID.
Request URL
curl --request PUT \
--url 'https://api.chatbot.com/training/train/text' \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
"storyId":"<Story ID>",
"targetId":"<User Input ID>",
"text": "hello world!"
}'
Parameters
Parameter | Type | Description |
---|---|---|
storyId |
Alphanumeric | required Story ID |
targetId |
Alphanumeric | required User Input interaction ID |
text |
String | required Text that should be trained |
Response example
{
"timestamp": "2022-06-29T13:55:34.677Z",
"status": {
"code": 200,
"type": "success"
}
}
Ignore phrases
Marks selected phrases as ignored. Ignored phrases won’t be displayed in the unmatched phrases list until the next occurrency.
Request URL
curl --request PUT \
--url 'https://api.chatbot.com/training/ignore' \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '[
"<Phrase ID>", "<2nd Phrase ID>"
]'
Parameters
Parameter | Type | Description |
---|---|---|
Phrase ID |
Array[Phrase ID] | required List of phrase(s) IDs |
Response example
{
"timestamp": "2022-06-29T13:57:44.753Z",
"status": {
"code": 200,
"type": "success"
}
}
Delete phrases
Deletes specific phrase(s) from the Training list.
Request URL
curl --request DELETE \
--url 'https://api.chatbot.com/training' \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '[
"<Phrase ID>", "<2nd Phrase ID>"
]'
Parameters
Parameter | Type | Description |
---|---|---|
Phrase ID |
Array[Phrase ID] | required List of phrase(s) IDs |
Response example
{
"timestamp": "2022-06-29T13:59:09.506Z",
"status": {
"code": 200,
"type": "success"
}
}