阿里云钉钉绑定组件规范
关于阿里云钉钉绑定组件的详细文档
配置 Dapr 组件
要配置阿里云钉钉绑定组件,请创建一个类型为 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"
警告
上述示例中使用了明文字符串作为密钥。建议使用密钥存储来存储密钥,详情请参阅此处。元数据字段说明
字段 | 必需 | 绑定支持 | 详情 | 示例 |
---|---|---|---|---|
id |
是 | 输入/输出 | 唯一标识符 | "test_webhook_id" |
url |
是 | 输入/输出 | 钉钉的 Webhook 地址 | "https://oapi.dingtalk.com/robot/send?access_token=******" |
secret |
否 | 输入/输出 | 钉钉 Webhook 的密钥 | "****************" |
direction |
否 | 输入/输出 | 绑定的方向 | "input" , "output" , "input, output" |
绑定支持
此组件支持输入和输出绑定接口。
此组件支持以下操作的输出绑定:
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"
}'
相关链接
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.