The documentation you are viewing is for Dapr v1.12 which is an older version of Dapr. For up-to-date documentation, see the latest version.
阿里云钉钉绑定规范
有关阿里云钉钉绑定组件的详细文档
	设置 Dapr 组件
要设置阿里云钉钉绑定,需要创建一个类型为 bindings.dingtalk.webhook 的组件。 请参阅 本指南 了解如何创建和应用 secretstore 配置。 有关如何在 Dapr 组件中检索和使用 secret,请参阅 引用 secrets 指南。
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: <NAME>
  namespace: <NAMESPACE>
spec:
  type: bindings.dingtalk.webhook
  version: v1
  metadata:
  - name: id
    value: "test_webhook_id"
  - name: url
    value: "https://oapi.dingtalk.com/robot/send?access_token=******"
  - name: secret
    value: "****************"
Warning
以上示例将密钥明文存储, 更推荐的方式是使用 Secret 组件, 这里。元数据字段规范
| 字段 | 必填 | 绑定支持 | 详情 | 示例 | 
|---|---|---|---|---|
| id | 是 | Input/Output | 唯一标识 | "test_webhook_id" | 
| url | 是 | Input/Output | 钉钉的 Webhook | "https://oapi.dingtalk.com/robot/send?access_token=******" | 
| secret | 否 | Input/Output | 钉钉 Webhook 的秘钥 | "****************" | 
绑定支持
此组件支持 输入和输出 绑定接口。
该组件支持如下操作的 输出绑定 :
createget
指定分区键
示例: 按照这里的说明设置 HTTP 请求
curl -X POST http://localhost:3500/v1.0/bindings/myDingTalk \
  -H "Content-Type: application/json" \
  -d '{
        "data": {
          "msgtype": "text",
          "text": {
            "content": "Hi"
          }
        },
        "operation": "create"
      }'
curl -X POST http://localhost:3500/v1.0/bindings/myDingTalk \
  -H "Content-Type: application/json" \
  -d '{
        "data": {
          "msgtype": "text",
          "text": {
            "content": "Hi"
          }
        },
        "operation": "get"
      }'
相关链接
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.