Stories

A story is a conversation scenario between customers and the bot. You can design the bot to do things like receiving pizza orders or scheduling doctor appointments or whatever you want.

List all stories

Returns a list of all stories on your account.

GET https://api.chatbot.com/v2/stories

Request URL

curl --request GET \
	--url https://api.chatbot.com/v2/stories \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

Response example

{
	"id": "62b3912312346a9000791232bf",
	"name": "My second story",
	"description": "This is my second story.",
	"version": 2,
	"published": true,
	"integrations": [
		"widget"
	],
	"metrics": []
},
{
	"id": "62b2fe1236a900072123215",
	"name": "My first story",
	"description": "Hello world!",
	"version": 2,
	"published": false,
	"integrations": [
		"widget"
	],
	"metrics": []
}

List single story

Returns a single story content.

GET https://api.chatbot.com/v2/stories/:storyId

Request URL

curl --request GET \
	--url https://api.chatbot.com/v2/stories/:storyId \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

URL Parameters

Parameter Type Description
storyId Alphanumeric required Story ID

Response example

{
    "id": "e1123123826a90007255215",
    "name": "My first story",
    "description": "Hello world!",
    "version": 2,
    "published": false,
    "integrations": [
        "widget"
    ],
    "settings": {
        "confidence": 0.7,
        "language": "en",
        "compact": true,
        "ignoreAttachments": true,
        "navigation": "mouse"
    },
    "state": {},
    "history": {
        "undo": true,
        "redo": false
    },
    "diagram": {
        "id": "5512339-1446-4e5b-8bc8-78f123e9da21",
        "type": "START_POINT",
        "name": "",
        "children": [
            {
                "id": "ec7a0607-b20e-4c30-8de1-5b61a3c92650",
                "type": "BOT_RESPONSE",
                "name": "Welcome message",
                "children": [
                    {
                        "id": "d79c1daf-3816-49e7-abb7-39f50caed0c5",
                        "type": "USER_INPUT",
                        "name": "Ask for name",
                        "children": []
                    }
                ]
            },
            {
                "id": "5312314c1-35fe-42b3-a344-bd3672ab1e72",
                "type": "DEFAULT_FALLBACK",
                "name": "Question not valid",
                "children": [
                    {
                        "id": "bba28467-ada0-4d2c-8ff2-21df7a4601c8",
                        "type": "BOT_RESPONSE",
                        "name": "Fallback message",
                        "children": []
                    }
                ]
            }
        ]
    }
}

Create new story

Creates a new ChatBot story on your account.

POST https://api.chatbot.com/v2/stories

Request URL

curl --request POST \
	--url https://api.chatbot.com/v2/stories \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'
	--header 'Content-Type: application/json' \
	--data-raw '{
		"name": "My third story",
		"description": "It will be great!"
	}'

Properties

Property Type Description
name String required Story name.
description String optional Story description.

Response example

{
	"id": "62bc55fd7606120006254b5f",
	"timestamp": "2022-06-29T13:39:09.573Z",
	"status": {
		"code": 201,
		"type": "created"
	}
}

Update existing story

Updates your ChatBot story metadata.

PUT https://api.chatbot.com/v2/stories/:storyId

Request URL

curl --request PUT \
	--url https://api.chatbot.com/v2/stories/:storyId \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

URL Parameters

Parameter Type Description
storyId Alphanumeric required Story ID

Properties

Property Type Description
name String required Story name.
description String optional Story description.

Response example

{
    "timestamp": "2022-06-29T13:42:16.029Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Delete story

Delets story with selected ID.

DEL https://api.chatbot.com/v2/stories/:storyId

Request URL

curl --request DELETE \
	--url https://api.chatbot.com/v2/stories/:storyId \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'

URL Parameters

Parameter Type Description
storyId Alphanumeric required Story ID

Response example

{
    "timestamp": "2022-06-29T13:42:16.029Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Start a free ChatBot trial
and build your first chatbot today!

Free 14-day trial No credit card required

Discover our text| products