Chatbot Entity
  • 11 Jul 2022
  • 2 Minutes to read
  • Dark
    Light

Chatbot Entity

  • Dark
    Light

Article summary

Chatbot Entity

Chatbot Entity JSON Format

Chatbot Entity is represented as simple flat JSON objects with the following keys:

NameTypeDescription
idguidId of the entity.
chatbotIdguidId of the chatbot.
namestringName of the entity.
chatbotEntityKeywordschatbotEntityKeywords[]Reference to Entity Keyword.

Entity Keyword JSON Format:

NameTypeDescription
idguidId of the entity keyword.
keywordstringKeyword.
synonymsstring []An array of string, synonyms list of keyword.
entityIdguidId of the entity.

Get a single Chatbot Entity

GET bot/chatbotEntities/{id}

  • Parameters:

NameTypeinRequiredDescription
includestringquerynoAllowed value is "chatbotEntityKeyword".
  • Response:

Chatbot Entity

  • 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:

NameTypeinRequiredDescription
keywordsstringquerynoSearch entity name or keyword or synonym by the keyword.
chatbotIdguidqueryyesId of the chatbot.
includestringquerynoAllowed value is "chatbotEntityKeyword".
sortBystringqueryyesAllowed 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:

NameTypeinRequiredDescription
chatbotIdguidbodyyesId of the chatbot.
namestringbodyyesName of the entity.
chatbotEntityKeywordschatbotEntityKeywords[]bodyyesReference to Entity Keyword.
  • Response:

Chatbot Entity

  • 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:

NameTypeinRequiredDescription
chatbotIdguidbodyyesId of the chatbot.
namestringbodyyesName of the entity.
chatbotEntityKeywordschatbotEntityKeywords[]bodyyesReference to Entity Keyword.
  • Response:

Chatbot Entity

  • 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?

What's Next