User entities
User Entities come with help when you need a data bucket relevant to your services. You can create your knowledge repositories to make your bot work smarter.
In user entities, you can list your products, branches, locations, services and everything you want. Moreover, you can create as many entities as you need.
List all user entities
Returns list of all created user entities.
Request URL
curl --request GET \
--url https://api.chatbot.com/entities \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'
Properties
Property | Type | Description |
---|---|---|
id |
String | User Entity id. |
name |
String | User entity name. |
entries |
Array.<Object> | An array of entries objects. |
Response Example
[
{
"id": "5a3be57a137efa00076cb579",
"name": "movies",
"entries": [
{
"synonyms": [
{
"value": "Star Wars"
},
{
"value": "SW"
}
],
"value": "Star Wars"
},
{
"synonyms": [
{
"value": "The Lord of the Rings"
},
{
"value": "LOTR"
},
{
"value": "The Fellowship of the Ring"
}
],
"value": "The Lord of the Rings"
}
]
}
]
Get single entity
Returns single entity object for the given id.
Request URL
curl --request GET \
--url https://api.chatbot.com/entities/:ID \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'
Properties
Property | Type | Description |
---|---|---|
id |
String | required User Entity id. |
Response Example
{
"id": "5a3be57a137efa00076cb579",
"name": "movies",
"entries": [
{
"synonyms": [
{
"value": "Star Wars"
},
{
"value": "SW"
}
],
"value": "Star Wars"
},
{
"synonyms": [
{
"value": "The Lord of the Rings"
},
{
"value": "LOTR"
},
{
"value": "The Fellowship of the Ring"
}
],
"value": "The Lord of the Rings"
}
]
}
Add new entity
Creates a new User Entity.
Request URL
curl --request POST \
--url https://api.chatbot.com/entities \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'content-type: application/json' \
--data '
{
"name": "movies",
"entries": [
{
"synonyms": [
{
"value": "Star Wars"
},
{
"value": "SW"
}
],
"value": "Star Wars"
},
{
"synonyms": [
{
"value": "The Lord of the Rings"
},
{
"value": "LOTR"
}
],
"value": "The Lord of the Rings"
}
]
}
'
Properties
Property | Type | Description |
---|---|---|
name |
String | User entity name. String(1, 128) |
entries |
Array.<Object> | An array of entries objects. Array(1, 2000) |
Response Example
{
"id": "58ee2e085d033800059a3f7f",
"timestamp": "2018-01-12T13:40:40.260Z",
"status": {
"code": 200,
"type": "success"
}
}
Update entity
Updates the specific User Entity.
Request URL
curl --request PUT \
--url https://api.chatbot.com/entities \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'content-type: application/json' \
--data '
{
"name": "movies",
"entries": [
{
"synonyms": [
{
"value": "Star Wars"
},
{
"value": "SW"
}
],
"value": "Star Wars"
},
{
"synonyms": [
{
"value": "The Lord of the Rings"
},
{
"value": "LOTR"
},
{
"value": "The Fellowship of the Ring"
}
],
"value": "The Lord of the Rings"
}
]
}
'
Properties
Property | Type | Description |
---|---|---|
name |
String | User entity name. String(1, 128) |
entries |
Array.<Object> | An array of entries objects. Array(1, 2000) |
Response Example
{
"id": "58ee2e085d033800059a3f7f",
"timestamp": "2018-01-12T13:40:40.260Z",
"status": {
"code": 200,
"type": "success"
}
}
Delete entity
Removes a entity with the given id.
Request URL
curl --request DEL \
--url https://api.chatbot.com/entities/:ID \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'content-type: application/json'
Properties
Property | Type | Description |
---|---|---|
id |
String | required User Entity id. |
Response Example
{
"timestamp": "2018-01-12T13:40:40.260Z",
"status": {
"code": 200,
"type": "success"
}
}
Common object definitions
Entries
An object which represents single entry in your User Entity.
Property | Type | Description |
---|---|---|
value |
String | Entry value. String(1, 1024) |
synonyms |
Array.<Object> | Array of synonyms objects for entry value. Array(1, 99) |
Entries Synonyms
Entry synonyms that will trigger the User Entity with the original entry value.
Property | Type | Description |
---|---|---|
value |
String | Synonym value. String(1, 1024) |