User entities

User Entities come with help when you need a data bucket relevant to your services. You can create your knowledge repositories to make your bot work smarter.

In user entities, you can list your products, branches, locations, services and everything you want. Moreover, you can create as many entities as you need.

List all user entities

Returns list of all created user entities.

GET https://api.chatbot.com/entities

Properties

Property Type Description
id String User Entity id.
name String User entity name.
entries Array.<Object> An array of entries objects.

Request URL

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

Response Example

[
    {
        "id": "5a3be57a137efa00076cb579",
        "name": "movies",
        "entries": [
            {
                "synonyms": [
                    {
                        "value": "Star Wars"
                    },
                    {
                        "value": "SW"
                    }
                ],
                "value": "Star Wars"
            },
            {
                "synonyms": [
                    {
                        "value": "The Lord of the Rings"
                    },
                    {
                        "value": "LOTR"
                    },
                    {
                        "value": "The Fellowship of the Ring"
                    }
                ],
                "value": "The Lord of the Rings"
            }
        ]
    }
]

Get single entity

Returns single entity object for the given id.

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

Request URL

Response Example

{
    "id": "5a3be57a137efa00076cb579",
    "name": "movies",
    "entries": [
        {
            "synonyms": [
                {
                    "value": "Star Wars"
                },
                {
                    "value": "SW"
                }
            ],
            "value": "Star Wars"
        },
        {
            "synonyms": [
                {
                    "value": "The Lord of the Rings"
                },
                {
                    "value": "LOTR"
                },
                {
                    "value": "The Fellowship of the Ring"
                }
            ],
            "value": "The Lord of the Rings"
        }
    ]
}

Properties

Property Type Description
id String User Entity id.
name String User entity name.
entries Array.<Object> An array of entries objects.

Add new entity

Creates a new User Entity.

POST https://api.chatbot.com/entities

Properties

Property Type Description
name String User entity name.

String(1, 128)
entries Array.<Object> An array of entries objects.

Array(1, 2000)

Request URL

curl --request POST \
	--url https://api.chatbot.com/entities \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
	--header 'content-type: application/json' \
	--data '
    {
        "name": "movies",
        "entries": [
            {
                "synonyms": [
                    {
                        "value": "Star Wars"
                    },
                    {
                        "value": "SW"
                    }
                ],
                "value": "Star Wars"
            },
            {
                "synonyms": [
                    {
                        "value": "The Lord of the Rings"
                    },
                    {
                        "value": "LOTR"
                    },
                    {
                        "value": "The Fellowship of the Ring"
                    }
                ],
                "value": "The Lord of the Rings"
            }
        ]
    }
'

Response Example

{
    "id": "58ee2e085d033800059a3f7f",
    "timestamp": "2018-01-12T13:40:40.260Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Update entity

Updates the specific User Entity.

PUT https://api.chatbot.com/entities/:ID

Properties

Property Type Description
name String User entity name.

String(1, 128)
entries Array.<Object> An array of entries objects.

Array(1, 2000)

Request URL

curl --request PUT \
	--url https://api.chatbot.com/entities \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
	--header 'content-type: application/json' \
	--data '
    {
        "name": "movies",
        "entries": [
            {
                "synonyms": [
                    {
                        "value": "Star Wars"
                    },
                    {
                        "value": "SW"
                    }
                ],
                "value": "Star Wars"
            },
            {
                "synonyms": [
                    {
                        "value": "The Lord of the Rings"
                    },
                    {
                        "value": "LOTR"
                    },
                    {
                        "value": "The Fellowship of the Ring"
                    }
                ],
                "value": "The Lord of the Rings"
            }
        ]
    }
'

Response Example

{
    "id": "58ee2e085d033800059a3f7f",
    "timestamp": "2018-01-12T13:40:40.260Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Delete entity

Removes a entity with the given id.

DEL https://api.chatbot.com/entities/:ID

Request URL

curl --request DEL \
	--url https://api.chatbot.com/entities/:ID \
	--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
	--header 'content-type: application/json'

Response Example

{
    "timestamp": "2018-01-12T13:40:40.260Z",
    "status": {
        "code": 200,
        "type": "success"
    }
}

Common object definitions

entries

An object which represents single entry in your User Entity.

Property Type Description
value String Entry value.

String(1, 1024)
synonyms Array.<Object> Array of synonyms objects for entry value.

Array(1, 99)

entries.synonyms

Property Type Description
value String Synonym value.

String(1, 1024)

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

Free 14-day trial No credit card required

Discover our other products