Chapter 10: Microsoft Teams & Google Chat
Microsoft Teams and Google Chat are the enterprise messaging platforms most common in large organizations. Both require more setup than consumer apps, but once connected, they give your AI agents access to the entire workforce through platforms they already use every day.
Part 1: Microsoft Teams
Overview
OpenClaw connects to Teams via the Azure Bot Framework. This requires an Azure subscription, but the Bot Framework tier is free for up to 300,000 messages per month โ more than enough for most teams.
Prerequisites
- Microsoft Azure account (azure.microsoft.com)
- Microsoft 365 account with Teams admin access
- Your OpenClaw gateway with a public HTTPS URL
Step 1: Create an Azure Bot
- Go to the Azure Portal
- Click Create a resource โ AI + Machine Learning โ Azure Bot
- Fill in:
- Bot handle:
openclaw-bot - Subscription: your subscription
- Resource group: create new or use existing
- Pricing tier: F0 (Free)
- Microsoft App ID: select Create new Microsoft App ID
- Bot handle:
- Click Review + Create โ Create
Step 2: Get Your App Credentials
- Once the bot is created, go to Configuration
- Note the Microsoft App ID
- Click Manage next to the App ID
- Go to Certificates & secrets โ New client secret
- Set expiry to 24 months, click Add
- Copy the Value immediately (only shown once) โ this is your App Password
Step 3: Configure the Messaging Endpoint
- In your Azure Bot's Configuration
- Set the Messaging endpoint to:
https://your-domain.com/webhooks/teams - Click Apply
Step 4: Add Teams Channel
- In your Azure Bot, go to Channels
- Click Microsoft Teams
- Accept the terms and click Apply
- The status should show Running
Step 5: Configure openclaw.json
{
"channels": {
"teams": {
"enabled": true,
"appId": "${TEAMS_APP_ID}",
"appPassword": "${TEAMS_APP_PASSWORD}",
"webhookPath": "/webhooks/teams",
"respondToMentions": true,
"respondToDMs": true
}
}
}
Set environment variables:
export TEAMS_APP_ID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
export TEAMS_APP_PASSWORD="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Step 6: Install the Bot in Teams
- In Teams, go to Apps โ Manage your apps โ Upload an app
- Download your bot's manifest from Azure Bot โ Channels โ Microsoft Teams โ Get bot embed code
- Zip the manifest files and upload to Teams
- The bot now appears in Teams and can be added to channels
Teams Allowlist
Teams allowlists use Azure AD user IDs (GUID format):
{
"workspaces": [
{
"id": "enterprise",
"channels": ["teams"],
"agent": "claude-sonnet",
"allowlist": [
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"
]
}
]
}
Find a user's Azure AD ID in the Azure Portal under Azure Active Directory โ Users โ [user] โ Object ID.
Teams Usage
Direct message the bot: Find OpenClaw in the Teams app list and send a DM.
Mention in a channel:
@OpenClaw help me write a SQL query for this report
Adaptive Cards: OpenClaw can send Teams-formatted Adaptive Cards for rich interactive responses โ enabled automatically when the Teams adapter detects the channel.
Part 2: Google Chat
Overview
OpenClaw connects to Google Chat via the Google Chat API using a service account. This requires a Google Workspace (G Suite) account โ it does not work with free Gmail accounts.
Prerequisites
- Google Workspace account (paid)
- Google Cloud project with billing enabled
- Admin access to your Google Workspace to publish the Chat app
Step 1: Create a Google Cloud Project
- Go to console.cloud.google.com
- Click Create Project
- Name it
openclaw-chat - Note the Project ID
Step 2: Enable the Chat API
- Go to APIs & Services โ Enable APIs & Services
- Search for Google Chat API
- Click Enable
Step 3: Create a Service Account
- Go to IAM & Admin โ Service Accounts
- Click Create Service Account
- Name:
openclaw-chat-bot - Grant role: Project โ Editor
- Click Done
- Click the service account โ Keys โ Add Key โ Create new key โ JSON
- Save the downloaded JSON file โ this is your credentials file
Step 4: Configure the Chat App
- Go to Google Chat API โ Configuration
- Fill in:
- App name:
OpenClaw - Avatar URL: your logo URL
- Description:
AI assistant powered by OpenClaw - Functionality: enable Receive 1:1 messages and Join spaces and group conversations
- Connection settings: select App URL
- App URL:
https://your-domain.com/webhooks/google-chat
- App name:
- Under Visibility, select Specific people and groups in your domain
- Click Save
Step 5: Configure openclaw.json
{
"channels": {
"google-chat": {
"enabled": true,
"credentialsPath": "${GOOGLE_CREDENTIALS_PATH}",
"webhookPath": "/webhooks/google-chat",
"projectId": "${GOOGLE_PROJECT_ID}"
}
}
}
export GOOGLE_CREDENTIALS_PATH="/home/user/.openclaw/google-credentials.json"
export GOOGLE_PROJECT_ID="openclaw-chat"
Step 6: Google Chat Allowlist
Google Chat allowlists use email addresses:
{
"workspaces": [
{
"id": "company",
"channels": ["google-chat"],
"agent": "claude-sonnet",
"allowlist": [
"alice@company.com",
"bob@company.com"
]
}
]
}
To allow everyone in your Google Workspace domain:
{
"allowlist": ["*@company.com"]
}
Google Chat Usage
Direct message the bot: Find OpenClaw in the Google Chat apps list and send a DM.
Mention in a Space:
@OpenClaw summarize the action items from this thread
Cards: Google Chat supports rich card responses with images, buttons, and structured sections โ OpenClaw uses these automatically for complex responses.
Troubleshooting
Microsoft Teams
| Problem | Solution |
|---|---|
| Bot not responding | Check messaging endpoint URL is correct and HTTPS |
| Authentication errors | Verify App ID and App Password match Azure Bot config |
| Bot not visible in Teams | Re-upload the app manifest with updated credentials |
| 401 Unauthorized | App Password may have expired โ create a new client secret |
Google Chat
| Problem | Solution |
|---|---|
| Webhook not verified | Check App URL is publicly accessible and returns HTTP 200 |
| Service account errors | Verify credentials JSON path is correct |
| Bot not appearing in search | Check visibility settings in Chat API configuration |
| Domain allowlist not working | Use exact domain format: *@yourdomain.com |
Enterprise Comparison
| Feature | Microsoft Teams | Google Chat |
|---|---|---|
| Setup difficulty | High | High |
| Requires paid account | Azure (free tier available) | Google Workspace (paid) |
| On-premises option | Teams Server | No |
| Adaptive/Rich cards | Yes | Yes |
| Thread support | Yes | Yes (Spaces) |
| Best for | Microsoft 365 orgs | Google Workspace orgs |
| Message limits | 300K/month free | API quota based |
Next: Chapter 11 โ All Chat Commands โ Every built-in slash command available to OpenClaw users across all channels.