Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 39 additions & 55 deletions docs/getting-started/channel-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,11 @@ After creation, note down:

### Step 3: Configure Graph API Permissions

In your App Registration, go to **API permissions** → **Add a permission** → **Microsoft Graph** → **Application permissions**.
In your App Registration, go to **API permissions** → **Add a permission** → **Microsoft Graph**.

Add the following permissions:
#### Application Permissions

Select **Application permissions** and add:

| Permission | Purpose |
|------------|---------|
Expand All @@ -812,9 +814,23 @@ Add the following permissions:
| `ChannelMessage.Read.All` | Read team channel message history |
| `User.Read.All` | Resolve user mentions and search users |

After adding all four, click **Grant admin consent for [your organization]** and confirm. All permissions should show a green checkmark.
#### Delegated Permissions

Go back to **Add a permission** → **Microsoft Graph** → **Delegated permissions** and add:

| Permission | Purpose |
|------------|---------|
| `Chat.ReadWrite` | Read and send chat messages on behalf of the user |
| `ChannelMessage.Send` | Send channel messages on behalf of the user |
| `ChannelMessage.Read.All` | Read channel messages on behalf of the user |
| `Files.Read.All` | Access files the user can access |
| `offline_access` | Maintain access when the user is not actively signed in |

#### Grant Admin Consent

After adding all 9 permissions (4 application + 5 delegated), click **Grant admin consent for [your organization]** and confirm. All permissions should show a green checkmark.

> **Important:** Admin consent is required. Without it, file downloads, chat history, and smart mode features will not work.
> **Important:** Admin consent is required. Without it, file downloads, chat history, emoji reactions, and smart mode features will not work.

### Step 4: Create an Azure Bot Resource

Expand Down Expand Up @@ -856,63 +872,31 @@ After connecting, the employee detail page displays a **Messaging Endpoint** URL

### Step 7: Create and Install the Teams App Manifest

To make the bot available in Teams, you need a Teams App Manifest:
To make the bot available in Teams, you need a Teams App Manifest — a `.zip` file containing a `manifest.json` and two icon files.

::: warning The manifest below is NOT copy-paste ready
You must replace all `<YOUR_APP_ID>` placeholders (3 places) with your actual App ID from Step 1 before zipping and uploading.
We provide a ready-made template with the COCO icon included. Download all three files:

- [manifest.json](/ms-teams-manifest/manifest.json) — app manifest template
- [color.png](/ms-teams-manifest/color.png) — 192x192 full-color app icon
- [outline.png](/ms-teams-manifest/outline.png) — 32x32 transparent outline icon

::: warning Edit manifest.json before zipping
Open `manifest.json` in any text editor and replace all placeholders with your actual values.
:::

1. Create a folder with three files:
**Placeholders to replace:**

**manifest.json:**
```json
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
"manifestVersion": "1.17",
"version": "1.0.0",
"id": "<YOUR_APP_ID>",
"developer": {
"name": "Your Company",
"websiteUrl": "https://coco.xyz",
"privacyUrl": "https://coco.xyz/privacy",
"termsOfUseUrl": "https://coco.xyz/terms"
},
"name": { "short": "COCO AI Employee" },
"description": {
"short": "AI-powered assistant",
"full": "COCO AI Employee connected via Microsoft Teams"
},
"icons": { "color": "color.png", "outline": "outline.png" },
"accentColor": "#4F6BED",
"bots": [{
"botId": "<YOUR_APP_ID>",
"scopes": ["personal", "team", "groupChat"],
"supportsFiles": true,
"isNotificationOnly": false
}],
"permissions": ["messageTeamMembers"],
"validDomains": [],
"webApplicationInfo": {
"id": "<YOUR_APP_ID>",
"resource": "https://graph.microsoft.com"
},
"authorization": {
"permissions": {
"resourceSpecific": [
{ "name": "ChatMessage.Read.Chat", "type": "Application" },
{ "name": "ChannelMessage.Read.Group", "type": "Application" }
]
}
}
}
```
| Placeholder | Replace With | Where |
|-------------|-------------|-------|
| `<YOUR_APP_ID>` | Your App ID from Step 1 | `id`, `botId`, `webApplicationInfo.id` (3 places) |
| `<YOUR_COMPANY_NAME>` | Your company or team name | `developer.name` |
| `<YOUR_BOT_DISPLAY_NAME>` | Bot name shown in Teams (e.g., `COCO AI Employee`) | `name.short` |
| `<SHORT_DESCRIPTION>` | One-line summary (e.g., `AI-powered assistant`) | `description.short` |
| `<FULL_DESCRIPTION>` | Longer description | `description.full` |

> **Note:** Replace `<YOUR_APP_ID>` in all three places (`id`, `botId`, `webApplicationInfo.id`). The `webApplicationInfo` section enables Graph API integration. The `resourceSpecific` permissions enable resource-specific consent (RSC) for reading messages in chats and channels where the bot is installed.
> **Note on scopes:** The `scopes` field defines where the bot can be used: `personal` = 1:1 DM conversations, `team` = team channels, `groupChat` = group chats. All three are enabled by default. The `resourceSpecific` permissions enable resource-specific consent (RSC) for reading messages in chats and channels where the bot is installed.

2. Add two icon files:
- **color.png** — 192x192 pixels, full-color app icon
- **outline.png** — 32x32 pixels, transparent outline icon
3. Zip all three files into a single `.zip` file
After editing `manifest.json`, select all three files and compress them into a single `.zip` file.

**Install in Teams:**
- **Sideload (testing):** In Teams → Apps → Manage your apps → Upload a custom app → select the `.zip`
Expand Down
Binary file added docs/public/ms-teams-manifest/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/public/ms-teams-manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
"manifestVersion": "1.17",
"version": "1.0.0",
"id": "<YOUR_APP_ID>",
"developer": {
"name": "<YOUR_COMPANY_NAME>",
"websiteUrl": "https://coco.xyz",
"privacyUrl": "https://coco.xyz/privacy",
"termsOfUseUrl": "https://coco.xyz/terms"
},
"name": { "short": "<YOUR_BOT_DISPLAY_NAME>" },
"description": {
"short": "<SHORT_DESCRIPTION>",
"full": "<FULL_DESCRIPTION>"
},
"icons": { "color": "color.png", "outline": "outline.png" },
"accentColor": "#4F6BED",
"bots": [{
"botId": "<YOUR_APP_ID>",
"scopes": ["personal", "team", "groupChat"],
"supportsFiles": true,
"isNotificationOnly": false
}],
"permissions": ["messageTeamMembers"],
"validDomains": [],
"webApplicationInfo": {
"id": "<YOUR_APP_ID>",
"resource": "https://graph.microsoft.com"
},
"authorization": {
"permissions": {
"resourceSpecific": [
{ "name": "ChatMessage.Read.Chat", "type": "Application" },
{ "name": "ChannelMessage.Read.Group", "type": "Application" }
]
}
}
}
Binary file added docs/public/ms-teams-manifest/outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 39 additions & 55 deletions docs/zh/getting-started/channel-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,9 +931,11 @@ Bot 需要独立身份。只有使用专属号码,其他人才能把它当作

### 第3步:配置 Graph API 权限

在 App Registration 页面,进入 **API permissions** → **Add a permission** → **Microsoft Graph** → **Application permissions**。
在 App Registration 页面,进入 **API permissions** → **Add a permission** → **Microsoft Graph**。

添加以下权限:
#### 应用程序权限(Application Permissions)

选择 **Application permissions**,添加以下权限:

| 权限 | 用途 |
|------|------|
Expand All @@ -942,9 +944,23 @@ Bot 需要独立身份。只有使用专属号码,其他人才能把它当作
| `ChannelMessage.Read.All` | 读取团队频道消息历史 |
| `User.Read.All` | 解析用户提及和搜索用户 |

全部添加后,点击 **Grant admin consent for [你的组织]** 并确认。所有权限应显示绿色勾号。
#### 委托权限(Delegated Permissions)

返回 **Add a permission** → **Microsoft Graph** → **Delegated permissions**,添加以下权限:

| 权限 | 用途 |
|------|------|
| `Chat.ReadWrite` | 代表用户读取和发送聊天消息 |
| `ChannelMessage.Send` | 代表用户发送频道消息 |
| `ChannelMessage.Read.All` | 代表用户读取频道消息 |
| `Files.Read.All` | 访问用户有权访问的文件 |
| `offline_access` | 在用户未主动登录时保持访问权限 |

#### 授予管理员同意

全部 9 项权限(4 项应用程序权限 + 5 项委托权限)添加完成后,点击 **Grant admin consent for [你的组织]** 并确认。所有权限应显示绿色勾号。

> **注意:** 必须获得管理员同意。否则文件下载、聊天历史和智能模式功能将无法使用。
> **注意:** 必须获得管理员同意。否则文件下载、聊天历史、表情回应和智能模式功能将无法使用。

### 第4步:创建 Azure Bot 资源

Expand Down Expand Up @@ -986,63 +1002,31 @@ Bot 需要独立身份。只有使用专属号码,其他人才能把它当作

### 第7步:创建并安装 Teams App Manifest

要让机器人在 Teams 中可用,需要创建 Teams App Manifest:
要让机器人在 Teams 中可用,需要一个 Teams App Manifest — 包含 `manifest.json` 和两个图标文件的 `.zip` 压缩包。

::: warning 以下 manifest 不能直接复制使用
你必须将其中所有 `<YOUR_APP_ID>` 占位符(共 3 处)替换为第1步中获取的实际 App ID,然后再打包上传。
我们提供了包含 COCO 图标的现成模板,下载以下三个文件:

- [manifest.json](/ms-teams-manifest/manifest.json) — 应用 manifest 模板
- [color.png](/ms-teams-manifest/color.png) — 192x192 全彩应用图标
- [outline.png](/ms-teams-manifest/outline.png) — 32x32 透明轮廓图标

::: warning 压缩前请编辑 manifest.json
用任意文本编辑器打开 `manifest.json`,将所有占位符替换为你的实际值。
:::

1. 创建一个文件夹,包含三个文件:
**需要替换的占位符:**

**manifest.json:**
```json
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.17/MicrosoftTeams.schema.json",
"manifestVersion": "1.17",
"version": "1.0.0",
"id": "<YOUR_APP_ID>",
"developer": {
"name": "Your Company",
"websiteUrl": "https://coco.xyz",
"privacyUrl": "https://coco.xyz/privacy",
"termsOfUseUrl": "https://coco.xyz/terms"
},
"name": { "short": "COCO AI Employee" },
"description": {
"short": "AI-powered assistant",
"full": "COCO AI Employee connected via Microsoft Teams"
},
"icons": { "color": "color.png", "outline": "outline.png" },
"accentColor": "#4F6BED",
"bots": [{
"botId": "<YOUR_APP_ID>",
"scopes": ["personal", "team", "groupChat"],
"supportsFiles": true,
"isNotificationOnly": false
}],
"permissions": ["messageTeamMembers"],
"validDomains": [],
"webApplicationInfo": {
"id": "<YOUR_APP_ID>",
"resource": "https://graph.microsoft.com"
},
"authorization": {
"permissions": {
"resourceSpecific": [
{ "name": "ChatMessage.Read.Chat", "type": "Application" },
{ "name": "ChannelMessage.Read.Group", "type": "Application" }
]
}
}
}
```
| 占位符 | 替换为 | 位置 |
|--------|-------|------|
| `<YOUR_APP_ID>` | 第1步获取的 App ID | `id`、`botId`、`webApplicationInfo.id`(共 3 处) |
| `<YOUR_COMPANY_NAME>` | 你的公司或团队名称 | `developer.name` |
| `<YOUR_BOT_DISPLAY_NAME>` | 在 Teams 中显示的 Bot 名称(如 `COCO AI 员工`) | `name.short` |
| `<SHORT_DESCRIPTION>` | 一句话简介(如 `AI 智能助手`) | `description.short` |
| `<FULL_DESCRIPTION>` | 详细描述 | `description.full` |

> **说明:** 将 `<YOUR_APP_ID>` 替换为你的实际 App ID(`id`、`botId`、`webApplicationInfo.id` 三处)。`webApplicationInfo` 部分启用 Graph API 集成。`resourceSpecific` 权限启用资源特定同意(RSC),允许在安装了机器人的聊天和频道中读取消息。
> **关于 scopes 字段:** `scopes` 定义 Bot 可以在哪些场景中使用:`personal` = 1对1私聊,`team` = 团队频道,`groupChat` = 群聊。默认三个都已启用。`resourceSpecific` 权限启用资源特定同意(RSC),允许在安装了机器人的聊天和频道中读取消息。

2. 添加两个图标文件:
- **color.png** — 192x192 像素,全彩应用图标
- **outline.png** — 32x32 像素,透明轮廓图标
3. 将三个文件压缩为一个 `.zip` 文件
编辑完 `manifest.json` 后,选中这三个文件压缩为一个 `.zip` 文件。

**在 Teams 中安装:**
- **侧载安装(测试):** Teams → Apps → Manage your apps → Upload a custom app → 选择 `.zip` 文件
Expand Down
Loading