Overview


Chatbot service enables you to create you own chatbots. You can customise the replies, add intents.


Beginner's Guide


Chatbots are AI models that can simulate conversation with a user. Chatbots are of two types.

Flow Based: These chatbots are used fill a form by pre-defining the questions and taking answers from user

Default chatbot are trained AI models where user can converse with any query.


Quickstart


Following : 11 services/APIs are provided by Chatbot as part of Release 2.0.0.

  • Create Chatbot : You can create chatbot with intents and respective responses.

  • Get Chatbot By ID : Can get chatbot by passing Id

  • Add Entity : You can add entities.

  • Add Intent : You can add intents.

  • Add Flow : You can add flow.

  • Converse : You can add converse.

  • Converse Suggestions : You can add converse suggestions.

  • Update Converse Suggestions : You can update converse suggestions.

  • Update Basic Suggestions : You can update basic suggestion.

  • Enable Social Webhooks : You can enable social webhooks.

  • Disable Social Webhooks : You can disable social webhooks.


APIs


All URIs below are relative to https://prod-kong.dltk.ai

Create Chatbot POST   /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/
Get Chatbot By ID GET   /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/
Add Entity PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/entity/
Add Intent PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/intent/
Add Flow PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/flow/
Get Flow GET  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/flow/
Converse GET  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/converse/
Converse Suggestions GET /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/converse/
Update Converse Suggestions PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/converse/
Enable Social Webhooks PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/social/enable/
Disable Social Webhooks PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/social/disable/

Create Chatbot

Description

This API would enable you create chatbot.

URI

POST  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/

Headers

api-key Your App's API Key

Request Example

{
    "name": "Pizza Chatbot 5.0",
    "type": "flow",
    "entities": [
        {
            "name": "Dips",
            "items": [
                "Mayo",
                "Cheese"
            ]
        }
    ],
    "intents": [
        {
            "intent": "I need dips",
            "responses": {
                "Mayo": "Mayo!",
                "Cheese": "Cheese!great",
                "default": ""
            },
            "prompt": {
                "response": "Which dip do youy want?",
                "entity": "Dips"
            }
        }
    ],
    "basic_conversation": {
        "doubtful_text": "Sorry. I didn't get you.Could you rephrase that?",
        "welcome_text": "Hey buddy! How can I help you?",
        "seeoff_text": "Happy to help you.Will see you soon!"
    },
    "flow_conversation": {
        "api_config": {
            "url": "http://someurl.here/api/v1/api_path"
        },
        "questions": [
            {
                "question": "What's your name?",
                "jsonKey": "name",
                "order": 1,
                "responseType": "input_text"
            }
        ]
    },
    "social_webhooks": {},
    "facebook_recipient_id": ""
}

Response

{
    "message": "chatbot created successfully."
}

Get Chatbot By ID

Description

This API would enable get chatbot by Id.

URI

GET  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/

Headers

api-key Your App's API Key

Request Example

[
    {
        "intents": [],
        "type": "FLOW",
        "app_id": "1559034052734",
        "social_webhooks": {},
        "id": "e28e233f-d50d-4fd6-9482-ac153d439aa8",
        "status": "READY",
        "name": "Pizza Chatbot 5.0",
        "created_time": "2019-06-07T05:03:21.426Z",
        "image": "static/bot_images/chatbot.png",
        "basic_conversation": {
            "seeoff_text": "Happy to help you.Will see you soon!",
            "welcome_text": "Hey buddy! How can I help you?",
            "doubtful_text": "Sorry. I didn't get you.Could you rephrase that?"
        },
        "entities": [],
        "facebook_recipient_id": "",
        "flow_conversation": {
            "questions": [
                {
                    "order": 1,
                    "responseType": "input_text",
                    "question": "What's your name?",
                    "jsonKey": "name"
                }
            ],
            "api_config": {
                "url": "http://someurl.here/api/v1/api_path"
            }
        }
    }
]

Add Entity

Description

This API would enable you create chatbot.

URI

PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/entity/

Headers

api-key Your App's API Key

Request Example

{
	"name" : "toppings",
	"items" : ["Pepperoni","Mushrooms","Onions","Sausage"]
}

Response

{
    "message": "entities saved successfully."
}

Add Intent

Description

This API would enable you create chatbot.

URI

PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/intent/

Headers

api-key Your App's API Key

Request Example

{
	"intent" : "I need toppings",
	"prompt-entity" : "toppings",
	"prompt-response" : "Which toppings do youy want?",
	"response" : "",
    "Pepperoni":"Awesome! Pepperoni",
    "Mushrooms":"Great!",
    "Onions":"Cool!",
    "Sausage":"Nice!"
}

Response

{
    "message": "intents saved successfully."
}

Add Flow

Description

This API would enable you create chatbot.

URI

PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/flow/

Headers

api-key Your App's API Key

Request Example

{
    "questions": [
    	{
            "question": "What's your Horoscope?",
            "options": ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"],
            "jsonKey": "horoscope",
            "order": 1
        },

        {
            "question": "What's your name?",
            "input": "text",
            "jsonKey": "name",
            "order": 2
        }
    ],
    "api_config": {
        "url": "http://someurl.here/api/v1/api_path",
        "method" : "POST"
    }
}

Response

{
    "message": "Update successful."
}

Get Flow

Description

This API would enable you get flow.

URI

GET  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/flow/

Headers

api-key Your App's API Key

Response

{
    "api_config": {
        "url": "http://someurl.here/api/v1/api_path",
        "method": "POST"
    },
    "questions": [
        {
            "order": 1,
            "options": [
                "Aries",
                "Taurus",
                "Gemini",
                "Cancer",
                "Leo",
                "Virgo",
                "Libra",
                "Scorpio",
                "Sagittarius",
                "Capricorn",
                "Aquarius",
                "Pisces"
            ],
            "question": "What's your Horoscope?",
            "jsonKey": "horoscope"
        },
        {
            "order": 2,
            "question": "What's your name?",
            "input": "text",
            "jsonKey": "name"
        }
        }
    ]
}

Converse

Description

This API would enable you get converse by giving a query.

URI

GET  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/converse/

Headers

api-key Your App's API Key

Request Example

{
	"query": "I need toppings"
}

Response

{
    "items": [
        "Pepperoni",
        "Mushrooms",
        "Onions",
        "Sausage"
    ],
    "entity": "toppings",
    "text": "Which toppings do youy want?"
}

Convese Suggestions

Description

This API would enable you get converse suggestion.

URI

GET  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/converse/

Headers

api-key Your App's API Key

Request Example

{
    "entity" : "toppings",
    "item": "Pepperoni"
}

Response

{
    "text": "Awesome! Pepperoni"
}

Update Converse Suggestions

Description

This API would enable you update converse default texts.

URI

PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/converse/

Headers

api-key Your App's API Key

Request Example

{
	"welcome_text":"Hi there. What's up?",
	"doubtful_text": "Hmm..Could you please rephrase that?",
	"seeoff_text" :"See you..Bbye. :)"
}

Response

{
    "message": "chatbot basic conversation updated successfully."
}

Enable Social Webhooks

Description

This API would enable chatbot for different platforms. Facebook is supported platform and many others platforms will be added soon.

URI

PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/social/enable/

Headers

api-key Your App's API Key

Request Example

{
	"access_token":XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"recipient_id": "*********",
	"platform" : "facebook"

}

Response

{
    "message": "Update successful."
}

Disable Social Webhooks

Description

This API would disable chatbot for the particular platform.

URI

PUT  /api/v1/chatbot-service/cloud-chatbot/ml/chatbot/social/disable

Headers

api-key Your App's API Key

Request Example

{
	"platform" : "facebook"
}

Response

{
    "message": "Update successful."
}


Release Notes


Folowing are the release notes as part of Release 2.0.0

  • Only one Chatbot can be created for one App

  • We support two types of Chatbots. Flow based and Default Chat based.

  • Helpdesk