Skip to main content

Getting Started with Conversational AI

Build a chatbot and put it on your website in three steps — create a dialog, add context, and deploy the Web Chat widget.

Prerequisites​

  • A CM.com account with Conversational AI access
  • Access to the Conversational AI dashboard

Step 1: Create your first dialog​

A dialog is a conversation building block that matches user intent and returns a response. Create one in the Conversational AI dashboard, or check the API is reachable:

curl -X GET https://api.cm.com/conversational/v1/health \
-H "Authorization: Bearer YOUR_API_KEY"
{
"status": "ok",
"service": "conversational-ai",
"version": "v1"
}

In the dashboard:

  1. Go to Conversational AI > Dialogs
  2. Click Create Dialog
  3. Define a greeting intent (e.g., keywords: "hello", "hi", "hey")
  4. Add a response: "Hi! How can I help you today?"

Step 2: Add context​

Use context variables to personalize conversations and maintain state across messages. For example, store the user's name and reference it in later responses.

Step 3: Deploy Web Chat​

Add the web chat widget to your website with a single script tag:

<script
src="https://webchat.cm.com/widget.js"
data-account-id="YOUR_ACCOUNT_ID"
data-bot-id="YOUR_BOT_ID"
async>
</script>

This renders a floating chat button on your site. Visitors can click it to start a conversation with your bot.

Next steps​