Alibaba Cloud DingTalk binding 规范

Alibaba Cloud DingTalk binding 组件的详细文档

设置 Dapr 组件

要设置 Alibaba Cloud DingTalk binding,请创建一个类型为 bindings.dingtalk.webhook 的组件。有关如何创建和应用 secretstore 配置,请参阅此指南。有关如何检索和使用密钥以及 Dapr 组件,请参阅此引用密钥指南。

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: <NAME>
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: "****************"
  - name: direction
    value: "input, output"

规范元数据字段

字段必填Binding 支持详情示例
idYInput/Output唯一 id"test_webhook_id"
urlYInput/OutputDingTalk 的 Webhook url"https://oapi.dingtalk.com/robot/send?access_token=******"
secretNInput/OutputDingTalk Webhook 的密钥"****************"
directionNInput/Outputbinding 的方向"input", "output", "input, output"

Binding 支持

此组件支持输入和输出 binding 接口。

此组件支持输出 binding,具有以下操作:

  • create
  • get

指定负载

示例:按照此处的说明设置负载数据

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"
      }'

相关链接