> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 群助手发送消息

> 本示例演示如何通过群助手向群聊发送消息，覆盖前提条件与完整操作步骤。

本示例介绍了如何发送群助手消息。

![群助手消息](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/9922390461/p377888.png)

1. 选择目标应用，进入应用详情页，单击基础信息 > 凭证与基础信息。
2. 获取应用 Client ID 和 Client Secret。
3. 申请发送群助手消息接口权限。
4. 获取应用访问凭证，[获取企业内部应用的accessToken](/zh/open/development/obtain-the-access-token-of-an-internal-app)。
5. 在开发者后台-场景群页面，申请[机器人](https://open-dev.dingtalk.io/fe/im#/robot/list)，审核通过后获取机器人id参数**robotCode**。
6. 在开发者后台-场景群页面，创建[群模板](https://open-dev.dingtalk.io/fe/im#/group/list)，获取群模板id参数**template\_id**。
7. 绑定[场景群-机器人](https://open-dev.dingtalk.io/fe/im#/robot/list)到[场景群-群模板](https://open-dev.dingtalk.io/fe/im#/group/list)，保存编辑，返回群场景列表。
8. 进入对应群模板，提交审核，点击发布。
9. 依据**template\_id**调用创建群接口，获取**openConversationId**。
10. 调用发送群助手消息接口，实现机器人群消息的发送。

## 前提条件

完成[创建应用](/zh/open/dingstart/create-application)的流程。

## 操作步骤

1. 选择目标应用，进入应用详情页，单击**基础信息** > **凭证与基础信息**。
2. 获取应用 Client ID 和 Client Secret。
3. 单击**开发配置** > **权限管理**，在权限搜索框中输入`qyapi_chat_manage`，并申请权限。
4. 获取应用访问凭证[获取企业内部应用的accessToken](/zh/open/development/obtain-the-access-token-of-an-internal-app)。调用接口时，通过accessToken鉴权调用者身份。
5. 在开发者后台-场景群页面，申请[机器人](https://open-dev.dingtalk.io/fe/im#/robot/list)，获取机器人ID参数，即**robotCode**。

### 说明

申请机器人需要审核，审批通过后可以查看ID，如下图所示。

![创建机器人](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/5854037361/p355281.png)

6. 在开发者后台-场景群页面，创建[群模板](https://open-dev.dingtalk.io/fe/im#/group/list)，获取群模板id参数**template\_id**。

![创建群模板1](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/4854037361/p355273.png)

7. 绑定[场景群-机器人](https://open-dev.dingtalk.io/fe/im#/robot/list)到[场景群-群模板](https://open-dev.dingtalk.io/fe/im#/group/list)，保存编辑，返回群场景列表。

![保存群模板](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/2473821461/p379280.png)

8. 进入对应群模板，进行提交审核，点击发布。

### 说明

审核自动通过，无需审批。

![发布流程](https://help-static-aliyun-doc.aliyuncs.com/assets/img/zh-CN/2473821461/p379282.png)

9. 通过**template\_id**调用创建群接口，获取**openConversationId**。
10. 调用发送群助手消息接口，实现机器人群消息的发送。
