Add Webex bot integration as a channel plugin supporting: - Bot token authentication via Webex Developer Portal - Webhook-based message receiving (messages:created events) - HMAC-SHA1 signature verification for webhook security - Direct message and group/space messaging - Media attachment support (images, files) - Pairing mode for DM authorization - Multi-account support Includes: - Full onboarding wizard for bot configuration - Probe functionality for connection testing - Channel status reporting - Documentation at docs/channels/webex.md - GitHub labeler configuration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5.8 KiB
5.8 KiB
| title | description |
|---|---|
| Webex | Connect Moltbot to Cisco Webex for enterprise messaging |
Webex Integration
Connect Moltbot to Cisco Webex to enable AI-powered conversations in your enterprise messaging environment.
Prerequisites
- A Webex account with bot creation permissions
- A publicly accessible URL for webhook delivery (your gateway URL)
Setup
1. Create a Webex Bot
- Go to the Webex Developer Portal
- Click Create a New App
- Select Create a Bot
- Fill in the bot details:
- Bot Name: A display name for your bot
- Bot Username: A unique identifier (e.g.,
moltbot) - Icon: Upload an avatar for your bot
- Description: A brief description
- Click Create Bot
- Important: Copy the Bot Access Token - you'll need this for configuration
2. Configure Moltbot
Run the setup wizard:
moltbot channels setup webex
Or configure manually:
channels:
webex:
enabled: true
botToken: "YOUR_BOT_ACCESS_TOKEN"
webhookSecret: "your-webhook-secret" # Create a strong secret
webhookPath: "/webex" # Default webhook endpoint
3. Create a Webhook
- Go to Webex Webhooks
- Create a webhook with these settings:
- Target URL:
https://your-gateway-url.com/webex - Resource:
messages - Event:
created - Secret: Use the same
webhookSecretfrom your config
- Target URL:
You can also create webhooks programmatically:
curl -X POST https://webexapis.com/v1/webhooks \
-H "Authorization: Bearer YOUR_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Moltbot Messages",
"targetUrl": "https://your-gateway-url.com/webex",
"resource": "messages",
"event": "created",
"secret": "your-webhook-secret"
}'
4. Add Bot to Spaces
- In Webex, open a space or create a new one
- Click the People icon
- Add your bot by its email address (shown after setup)
- The bot will now receive messages in that space
Configuration
Full Configuration Reference
channels:
webex:
enabled: true
# Authentication
botToken: "YOUR_BOT_ACCESS_TOKEN" # Required
# Webhook settings
webhookSecret: "your-webhook-secret" # Required for security
webhookPath: "/webex" # Default: /webex
webhookUrl: "https://..." # Optional: explicit webhook URL
# Bot identification (auto-detected if not set)
botId: "Y2lz..." # Optional: for precise @mention detection
botEmail: "bot@webex.bot" # Optional: bot's email address
# DM policy
dm:
policy: "pairing" # open, pairing, allowlist, disabled
allowFrom:
- "user@example.com"
- "Y2lzY29..." # Person ID
# Group/room policy
groupPolicy: "allowlist" # open, allowlist, disabled
# Room-specific configuration
rooms:
"ROOM_ID_HERE":
allow: true
requireMention: true # Only respond when @mentioned
systemPrompt: "Custom prompt for this room"
users: # Optional: restrict to specific users
- "user@example.com"
DM Policies
| Policy | Description |
|---|---|
open |
Anyone can DM the bot (use with caution) |
pairing |
New users must be approved before chatting |
allowlist |
Only users in dm.allowFrom can chat |
disabled |
No DMs allowed |
Group Policies
| Policy | Description |
|---|---|
open |
Bot responds in any space it's added to (mention-gated) |
allowlist |
Only configured rooms in rooms section |
disabled |
No group messages processed |
Environment Variables
For the default account, you can use environment variables:
| Variable | Description |
|---|---|
WEBEX_BOT_TOKEN |
Bot access token |
WEBEX_BOT_ID |
Bot's person ID |
WEBEX_BOT_EMAIL |
Bot's email address |
Multi-Account Support
Run multiple Webex bots with named accounts:
channels:
webex:
enabled: true
defaultAccount: "support"
accounts:
support:
name: "Support Bot"
botToken: "TOKEN_1"
webhookSecret: "secret1"
webhookPath: "/webex/support"
internal:
name: "Internal Bot"
botToken: "TOKEN_2"
webhookSecret: "secret2"
webhookPath: "/webex/internal"
Status & Troubleshooting
Check connection status:
moltbot channels status --probe
Common Issues
Bot not receiving messages
- Verify webhook is configured correctly in Webex
- Check that webhook secret matches your config
- Ensure gateway is accessible from the internet
- Check gateway logs for webhook errors
Authentication errors
- Verify bot token is valid:
moltbot channels status webex --probe - Regenerate token if expired (tokens don't expire but can be revoked)
@mention not detected
- Ensure
botIdis configured (auto-detected on first probe) - In group spaces, bot typically requires @mention to respond
API Limits
- Message length: 7,000 characters (markdown)
- File attachments: Webex handles file URLs directly
- Rate limits: Webex has rate limits; the plugin handles retries
Security Notes
- Webhook secret: Always use a strong, random secret for webhook verification
- Token security: Store bot tokens securely; never commit to version control
- DM policy: Use
pairingorallowlistin production to control access