Chatbot Entity
- 11 Jul 2022
- 2 Minutes to read
- Print
- DarkLight
Chatbot Entity
- Updated on 11 Jul 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?    
Thank you for your feedback!
Chatbot Entity
- Chatbot Entities- Chatbot Entities Manage- GET bot/chatbotEntities/{id}- Get a single Chatbot Entity
- GET bot/chatbots/{id}/chatbotEntities- Get the list of Chatbot Entities
- POST bot/chatbotEntities- Create a new Chatbot Entity
- PUT bot/chatbotEntities/{id}- Update the Chatbot Entity
- DELETE bot/chatbotEntities/{id}- Remove the Chatbot Entity
 
Chatbot Entity JSON Format
Chatbot Entity is represented as simple flat JSON objects with the following keys:
| Name | Type | Description | 
|---|---|---|
| id | guid | Id of the entity. | 
| chatbotId | guid | Id of the chatbot. | 
| name | string | Name of the entity. | 
| chatbotEntityKeywords | chatbotEntityKeywords[] | Reference to Entity Keyword. | 
Entity Keyword JSON Format:
| Name | Type | Description | 
|---|---|---|
| id | guid | Id of the entity keyword. | 
| keyword | string | Keyword. | 
| synonyms | string [] | An array of string, synonyms list of keyword. | 
| entityId | guid | Id of the entity. | 
Get a single Chatbot Entity
GET bot/chatbotEntities/{id}
- Parameters:
| Name | Type | in | Required | Description | 
|---|---|---|---|---|
| include | string | query | no | Allowed value is "chatbotEntityKeyword". | 
- Response:
- Example
Sample Request:
curl https://api11.comm100.io/v4/bot/chatbotEntities/73d07166-3dfc-4257-aec7-6b57b31684d1 \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 
Response:
HTTP/1.1 200 OK
{
  "id": "73d07166-3dfc-4257-aec7-6b57b31684d1",
  "chatbotId": "e8bf0d25-eed6-4a46-a417-318e15019609",
  "name": "color",
  "chatbotEntityKeywords": [
      {
          "id": "171163c7-01dc-4ab7-9e13-33dd85654f78",
          "keyword": "Pink",
          "synonyms": [
              "white pink"
          ],
          "entityId": "de6bfdf9-1ef8-4d76-986f-9b05b2dfa570"
      }
  ]
} 
Get the list of Chatbot Entities
GET bot/chatbots/{id}/chatbotEntities
- Parameters:
| Name | Type | in | Required | Description | 
|---|---|---|---|---|
| keywords | string | query | no | Search entity name or keyword or synonym by the keyword. | 
| chatbotId | guid | query | yes | Id of the chatbot. | 
| include | string | query | no | Allowed value is "chatbotEntityKeyword". | 
| sortBy | string | query | yes | Allowed values is "Name". | 
- Response:
An array of Chatbot Entity
- Example
Sample Request:
curl https://api11.comm100.io/v4/bot/chatbots/73d07166-3dfc-4257-aec7-6b57b31684d1/chatbotEntities \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 
Response:
HTTP/1.1 200 OK
{
  "chatbotEntities": [
      {
          "id": "73d07166-3dfc-4257-aec7-6b57b31684d1",
          "chatbotId": "e8bf0d25-eed6-4a46-a417-318e15019609",
          "name": "color",
          "chatbotEntityKeywords": [
              {
                  "id": "171163c7-01dc-4ab7-9e13-33dd85654f78",
                  "keyword": "Pink",
                  "synonyms": [
                      "white pink"
                  ],
                  "entityId": "de6bfdf9-1ef8-4d76-986f-9b05b2dfa570"
              }
          ]
      }
  ],
  "nextPage": null,
  "previousPage": null,
  "total": 1
} 
Create a new Chatbot Entity
POST bot/chatbotEntities
- Parameters:
| Name | Type | in | Required | Description | 
|---|---|---|---|---|
| chatbotId | guid | body | yes | Id of the chatbot. | 
| name | string | body | yes | Name of the entity. | 
| chatbotEntityKeywords | chatbotEntityKeywords[] | body | yes | Reference to Entity Keyword. | 
- Response:
- Example
Sample Request:
curl https://api11.comm100.io/v4/bot/chatbotEntities \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"chatbotId":"e8bf0d25-eed6-4a46-a417-318e15019609","name":"color","chatbotEntityKeywords":[{"keyword":"Pink","synonyms":["white pink"]}]}' 
Response:
HTTP/1.1 201 Created
{
  "id": "73d07166-3dfc-4257-aec7-6b57b31684d1",
  "chatbotId": "e8bf0d25-eed6-4a46-a417-318e15019609",
  "name": "color",
  "chatbotEntityKeywords": [
      {
          "id": "171163c7-01dc-4ab7-9e13-33dd85654f78",
          "keyword": "Pink",
          "synonyms": [
              "white pink"
          ],
          "entityId": "de6bfdf9-1ef8-4d76-986f-9b05b2dfa570"
      }
  ]
} 
Update the Chatbot Entity
PUT bot/chatbotEntities/{id}
- Parameters:
| Name | Type | in | Required | Description | 
|---|---|---|---|---|
| chatbotId | guid | body | yes | Id of the chatbot. | 
| name | string | body | yes | Name of the entity. | 
| chatbotEntityKeywords | chatbotEntityKeywords[] | body | yes | Reference to Entity Keyword. | 
- Response:
- Example
Sample Request:
curl https://api11.comm100.io/v4/bot/chatbotEntities/73d07166-3dfc-4257-aec7-6b57b31684d1 \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"chatbotId":"e8bf0d25-eed6-4a46-a417-318e15019609","name":"color","chatbotEntityKeywords":[{"keyword":"Pink","synonyms":["white pink"]}]}' 
Response:
HTTP/1.1 200 OK
{
  "id": "73d07166-3dfc-4257-aec7-6b57b31684d1",
  "chatbotId": "e8bf0d25-eed6-4a46-a417-318e15019609",
  "name": "color",
  "chatbotEntityKeywords": [
      {
          "id": "171163c7-01dc-4ab7-9e13-33dd85654f78",
          "keyword": "Pink",
          "synonyms": [
              "white pink"
          ],
          "entityId": "de6bfdf9-1ef8-4d76-986f-9b05b2dfa570"
      }
  ]
} 
Remove the Chatbot Entity
DELETE bot/chatbotEntities/{id}
- Parameters:
No Parameters
- Response:
No Content
- Example
Sample Request:
curl https://api11.comm100.io/v4/bot/chatbotEntities/73d07166-3dfc-4257-aec7-6b57b31684d1 \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 
Response:
HTTP/1.1 204 No Content
Was this article helpful?