Alibaba Cloud DingTalk binding spec

Detailed documentation on the Alibaba Cloud DingTalk binding component

Setup Dapr component

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. spec:
  6. type: bindings.dingtalk.webhook
  7. version: v1
  8. metadata:
  9. - name: id
  10. value: "test_webhook_id"
  11. - name: url
  12. value: "https://oapi.dingtalk.com/robot/send?access_token=******"
  13. - name: secret
  14. value: "****************"
  15. - name: direction
  16. value: "input, output"

Warning

The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.

Spec metadata fields

FieldRequiredBinding supportDetailsExample
idYInput/OutputUnique id“test_webhook_id”
urlYInput/OutputDingTalk’s Webhook urlhttps://oapi.dingtalk.com/robot/send?access_token=******
secretNInput/OutputThe secret of DingTalk’s Webhook**
directionNInput/OutputThe direction of the binding“input”, “output”, “input, output”

Binding support

This component supports both input and output binding interfaces.

This component supports output binding with the following operations:

  • 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. }'

Last modified October 11, 2024: Fixed typo (#4389) (fe17926)