Bot API
The Bot API allows you to retrieve information about your bot and its flows
Get bot
GET https://clients.csml.dev/v1/api/bot
Retrieve the bot for this integration
{
"id": "06e63f93-2e1a-4f76-b174-9c4aa6e31401",
"organization_id": "0b50ddf9-052b-4dd6-9901-459caa15ed33",
"name": "MyBot",
"description": "This is my bot",
"default_flow": "fd2e74e5-1305-4650-a300-8097d71df01f",
"created_at": "2019-12-11T18:59:39.391Z",
"updated_at": "2019-12-13T01:27:38.653Z",
"env": {
"MY_VAR": "somevalue"
},
"flows": [
{
"id": "fd2e74e5-1305-4650-a300-8097d71df01f",
"bot_id": "06e63f93-2e1a-4f76-b174-9c4aa6e31401",
"organization_id": "0b50ddf9-052b-4dd6-9901-459caa15ed33",
"name": "Default",
"description": "Default custom flow",
"commands": [
"/default"
],
"content": "start:\n\tsay \"hello!\"\n\tgoto end",
"created_at": "2019-12-11T18:59:39.610Z",
"updated_at": "2019-12-13T01:31:51.507Z",
},
...
]
}Update bot
PUT https://clients.csml.dev/v1/api/bot
Update a bot's name, default_flow and/or description. Parameters that are not set will not be changed.
Request Body
env
object
key/value hash of bot environment variables
default_flow
string
ID of default flow to set (flow must exist)
description
string
name
string
Get bot flows
GET https://clients.csml.dev/v1/api/bot/flows
Retrieve all the flows in the current bot
Create Flow
POST https://clients.csml.dev/v1/api/bot/flows
Add a new flow to the current bot
Request Body
description
string
Description of the flow to create
commands
array
Commands that will trigger the flow. Example: ["some", "command"]
content
string
CSML Flow
name
string
Name of the flow
Get flow
GET https://clients/csml.dev/v1/api/bot/flows/:flow_id
Path Parameters
flow_id
string
Update flow
PUT https://clients/csml.dev/v1/api/bot/flows/:flow_id
Path Parameters
flow_id
string
Request Body
commands
array
content
string
description
string
Bot usage
GET https://clients.csml.dev/v1/api/bot/usage
Get usage information about a bot
Validate bot
POST https://clients.csml.dev/v1/api/bot/validate
Validate bot data against the CSML interpreter
Request Body
object
The bot object as retrieved from the GET /bot operation
Build bot
POST https://clients.csml.dev/v1/api/bot/build
Build a new version of the bot
Get bot build version
GET https://clients.csml.dev/v1/api/bot/build
Query Parameters
version_id
string
ID of version to retrieve. Defaults to `latest` if not set.
Last updated
Was this helpful?