Chatbot
  • 07 Jul 2022
  • 11 Minutes to read
  • Dark
    Light

Chatbot

  • Dark
    Light

Article summary

Chatbot

Chatbot JSON Format

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

NameTypeDescription
idguidId of the chatbot.
languageIdstringLanguage of the chatbot.
namestringName of the chatbot.
thirdPartyWebhookUrlstringURL of the third party webhook. Webhook object, Only available when engine type is thirdParty. Default: https://.
trainingStatusenumAllowed values are succeeded, processing, failed.
importingStatusenumAllowed values are none, processing, succeeded, failed.
highConfidenceScoreintegerWhen visitor sends a message, bot will match it with all your intents. If the matching score (ranges from 0 to 100) is higher than the high confidence answer score, bot will reply with the intent that has the highest score. Default : 40.
noAnswerScoreintegerWhen visitor sends a message, bot will match it with all your intents. If the top matching score (ranges from 0 to 100) is between high confidence answer score and no answer score, Bot will send the answer of the top score intent as a possible answer to visitors. If the top matching score is lower than the no answer score, bot will send the message configured for when visitor question is not recognized. Default:20.
lastUpdatedTimetimestampThis attribute stores the last updated time for a chatbot. Once the chatbot or any sub attribute of the chatbot is edited, this value will be changed to the current time.
outputAudioEncodingstringAllowed values are "linear16", "oggOpus".
voiceGenderstringAllowed values are "male", "female".
ifCustomizeAvatarboolWhether avatar of bot is customize or not.
customizeAvatarimageURL of the customize avatar.
systemAvatarIdguidId of the system avatar.
veryNegativeScoreintegerChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is lower than the very negative score, Chatbot Sentiment Analysis will marked the sentiment of the message is very negative. Default: -8.
negativeScoreintegerChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the very negative score and the negative score, Chatbot Sentiment Analysis will marked the sentiment of the message is negative. Default: -3.
neutralScoreintegerChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the negative score and the neutral score, Chatbot Sentiment Analysis will marked the sentiment of the message is neutral. Default: 2.
positiveScoreintegerChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the neutral score and the positive score, Chatbot Sentiment Analysis will marked the sentiment of the message is positive. If the score is higher than the positive score, Chatbot Sentiment Analysis will marked the sentiment of the message is very positive. Default: 7.
ifSentimentboolWhether Chatbot Sentiment Analysis is used or not.
ifAutoTranslationbool
engineIdguidId of the chatbot engine.
descriptionstringDescription of the chatbot.
thirdPartyBotIdguid
thirdPartyBotVersioninteger
quickReplyStylesenumAllowed values are buttons, options.
avatarstringURL of the chatbot avatar.
engineChatbot EngineReference to .
channelIdsarrayThe list of channel that current chatbot support.

Chatbot Third Party WebHook Header JSON Format:

NameTypeDescription
chatbotIdguidId of the chatbot.
idguidId of the third-party bot webhook header.
keystringKey of the third-party bot webhook header.
valuestringValue of the third-party bot webhook header.

Chatbot Form Button Text JSON Format:

NameTypeDescription
formSubmitButtonTextstringSubmit button text.
formCancelButtonTextstringCancel button text.
formConfirmButtonTextstringConfirm button text.
chatbotIdguidId of the chatbot.

Get the list of Chatbot

GET bot/chatbots

  • Parameters:

NameTypeinRequiredDescription
channelIdstringquerynoChannel: Live Chat, Facebook Messenger, Twitter Direct Message, WeChat, WhatsApp, SMS.
includestringquerynoAllowed value is "chatbotThirdPartyWebhookHeader".
  • Response:

An array of Chatbot

  • Example

Sample Request:

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

Response:

HTTP/1.1 200 OK

{
  "chatbots": [
      {
          "id": "e8bf0d25-eed6-4a46-a417-318e15019609",
          "languageId": "en",
          "name": "Testchatbot",
          "thirdPartyWebhookUrl": "https://",
          "trainingStatus": "0",
          "importingStatus": "0",
          "highConfidenceScore": 40,
          "noAnswerScore": 20,
          "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
          "outputAudioEncoding": "linear16",
          "voiceGender": "male",
          "ifCustomizeAvatar": false,
          "customizeAvatar": "",
          "systemAvatarId": "00000000-0000-0000-0000-000000000001",
          "veryNegativeScore": -8,
          "negativeScore": -3,
          "neutralScore": 2,
          "positiveScore": 7,
          "ifSentiment": false,
          "ifAutoTranslation": true,
          "engineId": "266b567c-c716-43c4-84e1-5723f5badfaf",
          "description": "",
          "thirdPartyBotId": "",
          "thirdPartyBotVersion": 1,
          "quickReplyStyles": "",
          "avatar": "https://api11.comm100.io/v4/Bot/chatbots/e8bf0d25-eed6-4a46-a417-318e15019609/avatar",
          "engine": {
              "id": "bbec7c36-9c72-4789-8e07-8951c22eb945",
              "name": ""
          },
          "channelIds": [
              "Live Chat"
          ]
      }
  ],
  "nextPage": null,
  "previousPage": null,
  "total": 1
} 

Get a single Chatbot

GET bot/chatbots/{id}

  • Parameters:

NameTypeinRequiredDescription
includestringquerynoAllowed value is "chatbotThirdPartyWebhookHeader".
  • Response:

Chatbot

  • Example

Sample Request:

curl https://api11.comm100.io/v4/bot/chatbots/e8bf0d25-eed6-4a46-a417-318e15019609 \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": "e8bf0d25-eed6-4a46-a417-318e15019609",
  "languageId": "en",
  "name": "Testchatbot",
  "thirdPartyWebhookUrl": "https://",
  "trainingStatus": "0",
  "importingStatus": "0",
  "highConfidenceScore": 40,
  "noAnswerScore": 20,
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "outputAudioEncoding": "linear16",
  "voiceGender": "male",
  "ifCustomizeAvatar": false,
  "customizeAvatar": "",
  "systemAvatarId": "00000000-0000-0000-0000-000000000001",
  "veryNegativeScore": -8,
  "negativeScore": -3,
  "neutralScore": 2,
  "positiveScore": 7,
  "ifSentiment": false,
  "ifAutoTranslation": true,
  "engineId": "266b567c-c716-43c4-84e1-5723f5badfaf",
  "description": "",
  "thirdPartyBotId": "",
  "thirdPartyBotVersion": 1,
  "quickReplyStyles": "",
  "avatar": "https://api11.comm100.io/v4/Bot/chatbots/e8bf0d25-eed6-4a46-a417-318e15019609/avatar",
  "engine": {
      "id": "bbec7c36-9c72-4789-8e07-8951c22eb945",
      "name": ""
  },
  "channelIds": [
      "Live Chat"
  ]
} 

Create a new Chatbot

POST bot/chatbots

  • Parameters:

NameTypeinRequiredDescription
languageIdstringbodyyesLanguage of the chatbot.
namestringbodyyesName of the chatbot.
thirdPartyWebhookUrlstringbodyyesURL of the third party webhook. Webhook object, Only available when engine type is thirdParty. Default: https://.
trainingStatusenumbodynoAllowed values are succeeded, processing, failed.
importingStatusenumbodynoAllowed values are none, processing, succeeded, "failed".
highConfidenceScoreintegerbodynoWhen visitor sends a message, bot will match it with all your intents. If the matching score (ranges from 0 to 100) is higher than the high confidence answer score, bot will reply with the intent that has the highest score. Default : 40.
noAnswerScoreintegerbodynoWhen visitor sends a message, bot will match it with all your intents. If the top matching score (ranges from 0 to 100) is between high confidence answer score and no answer score, Bot will send the answer of the top score intent as a possible answer to visitors. If the top matching score is lower than the no answer score, bot will send the message configured for when visitor question is not recognized. Default:20.
outputAudioEncodingstringbodyyesAllowed values are "linear16", "oggOpus".
voiceGenderstringbodyyesAllowed values are "male", "female".
ifCustomizeAvatarboolbodynoWhether avatar of bot is customize or not.
customizeAvatarimagebodynoURL of the customize avatar.
systemAvatarIdguidbodynoId of the system avatar.
veryNegativeScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is lower than the very negative score, Chatbot Sentiment Analysis will marked the sentiment of the message is very negative. Default: -8.
negativeScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the very negative score and the negative score, Chatbot Sentiment Analysis will marked the sentiment of the message is negative. Default: -3.
neutralScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the negative score and the neutral score, Chatbot Sentiment Analysis will marked the sentiment of the message is neutral. Default: 2.
positiveScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the neutral score and the positive score, Chatbot Sentiment Analysis will marked the sentiment of the message is positive. If the score is higher than the positive score, Chatbot Sentiment Analysis will marked the sentiment of the message is very positive. Default: 7.
ifSentimentboolbodynoWhether Chatbot Sentiment Analysis is used or not.
ifAutoTranslationboolbodyno
descriptionstringbodynoDescription of the chatbot.
thirdPartyBotIdguidbodynoWhen Chatbot Engine is IBM Watson, thirdPartyBotId is required.
thirdPartyBotVersionintegerbodyno
quickReplyStylesenumbodynoAllowed values are buttons, options.
avatarstringbodynoURL of the chatbot avatar.
chatbotThirdPartyWebhookHeaderschatbotThirdPartyWebhookHeaders[]bodynoReference to Chatbot Third Party WebHook Header.
chatbotFormButtonTextchatbotFormButtonTextbodynoReference to Chatbot Form Button Text.
channelIdsarraybodynoThe list of channel that current chatbot support.
  • Response:

Chatbot

  • Example

Sample Request:

curl https://api11.comm100.io/v4/bot/chatbots \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"languageId":"en","name":"Testchatbot","thirdPartyWebhookUrl":"https://","trainingStatus":"0","importingStatus":"0","highConfidenceScore":40,"noAnswerScore":20,"outputAudioEncoding":"linear16","voiceGender":"male","ifCustomizeAvatar":false,"customizeAvatar":"","systemAvatarId":"00000000-0000-0000-0000-000000000001","veryNegativeScore":-8,"negativeScore":-3,"neutralScore":2,"positiveScore":7,"ifSentiment":false,"ifAutoTranslation":true,"description":"","thirdPartyBotId":"","thirdPartyBotVersion":1,"usedActionsForTesting":1,"engineId":"266b567c-c716-43c4-84e1-5723f5badfaf","chatbotThirdPartyWebhookHeaders":[{"key":"Content-Type","value":"application/json"}],"chatbotFormButtonText":{"formSubmitButtonText":"Submit","formCancelButtonText":"Cancel","formConfirmButtonText":"Confirm"}}'

Response:

HTTP/1.1 201 Created

{
  "id": "e8bf0d25-eed6-4a46-a417-318e15019609",
  "languageId": "en",
  "name": "Testchatbot",
  "thirdPartyWebhookUrl": "https://",
  "trainingStatus": "0",
  "importingStatus": "0",
  "highConfidenceScore": 40,
  "noAnswerScore": 20,
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "outputAudioEncoding": "linear16",
  "voiceGender": "male",
  "ifCustomizeAvatar": false,
  "customizeAvatar": "",
  "systemAvatarId": "00000000-0000-0000-0000-000000000001",
  "veryNegativeScore": -8,
  "negativeScore": -3,
  "neutralScore": 2,
  "positiveScore": 7,
  "ifSentiment": false,
  "ifAutoTranslation": true,
  "engineId": "266b567c-c716-43c4-84e1-5723f5badfaf",
  "description": "",
  "thirdPartyBotId": "",
  "thirdPartyBotVersion": 1,
  "quickReplyStyles": "",
  "avatar": "https://api11.comm100.io/v4/Bot/chatbots/e8bf0d25-eed6-4a46-a417-318e15019609/avatar",
  "engine": {
      "id": "bbec7c36-9c72-4789-8e07-8951c22eb945",
      "name": ""
  },
  "channelIds": [
      "Live Chat"
  ]
} 

Update the Chatbot

PUT bot/chatbots/{id}

  • Parameters:

NameTypeinRequiredDescription
languageIdstringbodyyesLanguage of the chatbot.
namestringbodyyesName of the chatbot.
thirdPartyWebhookUrlstringbodyyesURL of the third party webhook. Webhook object, Only available when engine type is thirdParty. Default: https://.
trainingStatusstringbodynoAllowed values are "succeeded", "processing", "failed".
importingStatusstringbodynoAllowed values are "none", "processing", "succeeded", "failed".
highConfidenceScoreintegerbodynoWhen visitor sends a message, bot will match it with all your intents. If the matching score (ranges from 0 to 100) is higher than the high confidence answer score, bot will reply with the intent that has the highest score. Default : 40.
noAnswerScoreintegerbodynoWhen visitor sends a message, bot will match it with all your intents. If the top matching score (ranges from 0 to 100) is between high confidence answer score and no answer score, Bot will send the answer of the top score intent as a possible answer to visitors. If the top matching score is lower than the no answer score, bot will send the message configured for when visitor question is not recognized. Default:20.
outputAudioEncodingstringbodyyesAllowed values are "linear16", "oggOpus".
voiceGenderstringbodyyesAllowed values are "male", "female".
ifCustomizeAvatarboolbodynoWhether avatar of bot is customize or not.
customizeAvatarimagebodynoURL of the customize avatar.
systemAvatarIdguidbodynoId of the system avatar.
veryNegativeScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is lower than the very negative score, Chatbot Sentiment Analysis will marked the sentiment of the message is very negative. Default: -8.
negativeScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the very negative score and the negative score, Chatbot Sentiment Analysis will marked the sentiment of the message is negative. Default: -3.
neutralScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the negative score and the neutral score, Chatbot Sentiment Analysis will marked the sentiment of the message is neutral. Default: 2.
positiveScoreintegerbodynoChatbot Sentiment Analysis analyzes the messages you visitors send during the conversation with you chatbot. If the score (ranges from -10 to 10) is betweent the neutral score and the positive score, Chatbot Sentiment Analysis will marked the sentiment of the message is positive. If the score is higher than the positive score, Chatbot Sentiment Analysis will marked the sentiment of the message is very positive. Default: 7.
ifSentimentboolbodynoWhether Chatbot Sentiment Analysis is used or not.
ifAutoTranslationboolbodyno
descriptionstringbodynoDescription of the chatbot.
thirdPartyBotIdguidbodynoWhen Chatbot Engine is IBM Watson, thirdPartyBotId is required.
thirdPartyBotVersionintegerbodyno
quickReplyStylesstringbodynoAllowed values are "buttons", "options".
avatarstringbodynoURL of the chatbot avatar.
chatbotThirdPartyWebhookHeaderschatbotThirdPartyWebhookHeaders[]bodynoReference to Chatbot Third Party WebHook Header.
chatbotFormButtonTextchatbotFormButtonTextbodynoReference to Chatbot Form Button Text.
channelIdsarraybodynoThe list of channel that current chatbot support.
  • Response:

Chatbot

  • Example

Sample Request:

curl https://api11.comm100.io/v4/bot/chatbots/e8bf0d25-eed6-4a46-a417-318e15019609 \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"languageId":"en","name":"Testchatbot","thirdPartyWebhookUrl":"https://","trainingStatus":"0","importingStatus":"0","highConfidenceScore":40,"noAnswerScore":20,"outputAudioEncoding":"linear16","voiceGender":"male","ifCustomizeAvatar":false,"customizeAvatar":"","systemAvatarId":"00000000-0000-0000-0000-000000000001","veryNegativeScore":-8,"negativeScore":-3,"neutralScore":2,"positiveScore":7,"ifSentiment":false,"ifAutoTranslation":true,"description":"","thirdPartyBotId":"","thirdPartyBotVersion":1,"quickReplyStyles":"","chatbotThirdPartyWebhookHeaders":[{"key":"Content-Type","value":"application/json"}],"chatbotFormButtonText":{"formSubmitButtonText":"Submit","formCancelButtonText":"Cancel","formConfirmButtonText":"Confirm"}}' 

Response:

HTTP/1.1 200 OK

{
  "id": "e8bf0d25-eed6-4a46-a417-318e15019609",
  "languageId": "en",
  "name": "Testchatbot",
  "thirdPartyWebhookUrl": "https://",
  "trainingStatus": "0",
  "importingStatus": "0",
  "highConfidenceScore": 40,
  "noAnswerScore": 20,
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "outputAudioEncoding": "linear16",
  "voiceGender": "male",
  "ifCustomizeAvatar": false,
  "customizeAvatar": "",
  "systemAvatarId": "00000000-0000-0000-0000-000000000001",
  "veryNegativeScore": -8,
  "negativeScore": -3,
  "neutralScore": 2,
  "positiveScore": 7,
  "ifSentiment": false,
  "ifAutoTranslation": true,
  "engineId": "266b567c-c716-43c4-84e1-5723f5badfaf",
  "description": "",
  "thirdPartyBotId": "",
  "thirdPartyBotVersion": 1,
  "quickReplyStyles": "",
  "avatar": "https://api11.comm100.io/v4/Bot/chatbots/e8bf0d25-eed6-4a46-a417-318e15019609/avatar",
  "engine": {
      "id": "bbec7c36-9c72-4789-8e07-8951c22eb945",
      "name": ""
  },
  "channelIds": [
      "Live Chat"
  ]
} 

Delete the Chatbot

DELETE bot/chatbots/{id}

  • Parameters:

No Parameters

  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/bot/chatbots/e8bf0d25-eed6-4a46-a417-318e15019609 \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 204 No Content


Was this article helpful?