Chatbot Intent Question
  • 11 Jul 2022
  • 3 Minutes to read
  • Dark
    Light

Chatbot Intent Question

  • Dark
    Light

Article summary

Chatbot Intent Question

Chatbot Intent Question JSON Format

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

NameTypeDescription
idguidId of the intent question.
orderintegerMust be greater than or equal to 0, ascending order.
intentIdguidId of the intent.
contentstringVisitor questions that tigger this intent.
chatbotIntentQuestionKeywordschatbotIntentQuestionKeywords[]Reference to Chatbot Intent Question Keyword.

Chatbot Intent Question Keyword JSON Format:

NameTypeDescription
idguidId of the chatbot intent question keyword.
intentQuestionIdguidId of the chatbot intent question.
variableNamestringLabel to distinguish same entity marked on one question.
startPositionintegerStart index of current question you marked.
endPositionintegerEnd index of current question you marked.
ifPrebuiltEntityboolWhether marked entity is prebuilt entity or custom entity.
prebuiltEntityIdguidId of the marked prebuilt entity.
entityIdguidId of the entity marked in one question.
entityentityReference to Chatbot Entity.
prebuiltEntityprebuiltEntityReference to Prebuilt Entity.

Get the list of Chatbot Intent Questions

GET bot/chatbotIntentQuestions

  • Parameters:

NameTypeinRequiredDescription
intentIdguidquerynoId of the intent.
includestringquerynoAllowed value is "chatbotIntentQuestionKeyword".
  • Response:

An array of Chatbot Intent Question

  • Example

Sample Request:

curl https://api11.comm100.io/v4/bot/chatbotIntentQuestions \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

[
  {
      "id": "83d2660f-b7e6-409a-b072-896a4ee4914a",
      "order": 0,
      "intentId": "2fde3f7e-8c23-4852-97be-a28fa5289d0e",
      "content": "Hello",
      "chatbotIntentQuestionKeywords": [
          {
              "id": "45e7763e-f20d-4324-ab35-b51a70ae8680",
              "intentQuestionId": "ee3ce615-38f8-469c-abcf-4a51e79fd54b",
              "variableName": "color",
              "startPosition": 5,
              "endPosition": 20,
              "ifPrebuiltEntity": false,
              "prebuiltEntityId": "00000000-0000-0000-0000-000000000000",
              "entityId": "d394618e-6c2a-444f-b4b3-5b88ed2466ad",
              "entity": {
                  "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"
                      }
                  ]
              },
              "prebuiltEntity": {
                  "dialogflowEntityId": "376B93B1-C148-EB11-8100-00155D081D0B",
                  "id": "386B93B1-C148-EB11-8100-00155D081D0B",
                  "name": "entity",
                  "description": "description",
                  "example": [
                      "entity1",
                      "entity2"
                  ],
                  "languageCode": "en"
              }
          }
      ]
  }
] 

Get a single Chatbot Intent Question

GET bot/chatbotIntentQuestions/{id}

  • Parameters:

NameTypeinRequiredDescription
includestringquerynoAllowed value is "chatbotIntentQuestionKeyword".
  • Response:

Chatbot Intent Question

  • Example

Sample Request:

curl https://api11.comm100.io/v4/bot/chatbotIntentQuestions/83d2660f-b7e6-409a-b072-896a4ee4914a \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": "83d2660f-b7e6-409a-b072-896a4ee4914a",
  "order": 0,
  "intentId": "2fde3f7e-8c23-4852-97be-a28fa5289d0e",
  "content": "Hello",
  "chatbotIntentQuestionKeywords": [
      {
          "id": "45e7763e-f20d-4324-ab35-b51a70ae8680",
          "intentQuestionId": "ee3ce615-38f8-469c-abcf-4a51e79fd54b",
          "variableName": "color",
          "startPosition": 5,
          "endPosition": 20,
          "ifPrebuiltEntity": false,
          "prebuiltEntityId": "00000000-0000-0000-0000-000000000000",
          "entityId": "d394618e-6c2a-444f-b4b3-5b88ed2466ad",
          "entity": {
              "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"
                  }
              ]
          },
          "prebuiltEntity": {
              "dialogflowEntityId": "376B93B1-C148-EB11-8100-00155D081D0B",
              "id": "386B93B1-C148-EB11-8100-00155D081D0B",
              "name": "entity",
              "description": "description",
              "example": [
                  "entity1",
                  "entity2"
              ],
              "languageCode": "en"
          }
      }
  ]
} 

Create a new Chatbot Intent Question

POST bot/chatbotIntentQuestions

  • Parameters:

NameTypeinRequiredDescription
orderintegerbodynoMust be greater than or equal to 0, ascending order.
intentIdguidbodyyesId of the intent.
contentstringbodyyesVisitor questions that tigger this intent.
chatbotIntentQuestionKeywordschatbotIntentQuestionKeywords[]bodynoReference to Chatbot Intent Question Keyword.
  • Response:

Chatbot Intent Question

  • Example

Sample Request:

curl https://api11.comm100.io/v4/bot/chatbotIntentQuestions \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"order":0,"intentId":"2fde3f7e-8c23-4852-97be-a28fa5289d0e","content":"Hello","chatbotIntentQuestionKeywords":[{"variableName":"color","startPosition":5,"endPosition":20,"ifPrebuiltEntity":false,"prebuiltEntityId":"00000000-0000-0000-0000-000000000000","entityId":"d394618e-6c2a-444f-b4b3-5b88ed2466ad"}]}' 

Response:

HTTP/1.1 201 Created

{
  "id": "83d2660f-b7e6-409a-b072-896a4ee4914a",
  "order": 0,
  "intentId": "2fde3f7e-8c23-4852-97be-a28fa5289d0e",
  "content": "Hello",
  "chatbotIntentQuestionKeywords": [
      {
          "id": "45e7763e-f20d-4324-ab35-b51a70ae8680",
          "intentQuestionId": "ee3ce615-38f8-469c-abcf-4a51e79fd54b",
          "variableName": "color",
          "startPosition": 5,
          "endPosition": 20,
          "ifPrebuiltEntity": false,
          "prebuiltEntityId": "00000000-0000-0000-0000-000000000000",
          "entityId": "d394618e-6c2a-444f-b4b3-5b88ed2466ad",
          "entity": {
              "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"
                  }
              ]
          },
          "prebuiltEntity": {
              "dialogflowEntityId": "376B93B1-C148-EB11-8100-00155D081D0B",
              "id": "386B93B1-C148-EB11-8100-00155D081D0B",
              "name": "entity",
              "description": "description",
              "example": [
                  "entity1",
                  "entity2"
              ],
              "languageCode": "en"
          }
      }
  ]
} 

Was this article helpful?