Alibaba Cloud DingTalk binding spec

Detailed documentation on the Alibaba Cloud DingTalk binding component

设置 Dapr 组件

To setup an Alibaba Cloud DingTalk binding create a component of type bindings.dingtalk.webhook. See this guide on how to create and apply a secretstore configuration. See this guide on referencing secrets to retrieve and use the secret with Dapr components.

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: <NAME>
  5. namespace: <NAMESPACE>
  6. spec:
  7. type: bindings.dingtalk.webhook
  8. version: v1
  9. metadata:
  10. - name: id
  11. value: "test_webhook_id"
  12. - name: url
  13. value: "https://oapi.dingtalk.com/robot/send?access_token=******"
  14. - name: secret
  15. value: "****************"

Warning

以上示例将密钥明文存储, It is recommended to use a secret store for the secrets as described here.

元数据字段规范

字段必填绑定支持详情Example
idYInput/Outputunique id“test_webhook_id”
urlYInput/OutputDingTalk’s Webhook urlhttps://oapi.dingtalk.com/robot/send?access_token=******
密钥NInput/Outputthe secret of DingTalk’s Webhook**

相关链接

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

字段名为 ttlInSeconds

  • create
  • get

Specifying a partition key

Example: Follow the instructions here on setting the data of payload

  1. curl -X POST http://localhost:3500/v1.0/bindings/myDingTalk \
  2. -H "Content-Type: application/json" \
  3. -d '{
  4. "data": {
  5. "msgtype": "text",
  6. "text": {
  7. "content": "Hi"
  8. }
  9. },
  10. "operation": "create"
  11. }'
  1. curl -X POST http://localhost:3500/v1.0/bindings/myDingTalk \
  2. -H "Content-Type: application/json" \
  3. -d '{
  4. "data": {
  5. "msgtype": "text",
  6. "text": {
  7. "content": "Hi"
  8. }
  9. },
  10. "operation": "get"
  11. }'

相关链接