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.
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
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
Field | Required | Binding support | Details | Example |
---|---|---|---|---|
id | Y | Input/Output | unique id | “test_webhook_id” |
url | Y | Input/Output | DingTalk’s Webhook url | “https://oapi.dingtalk.com/robot/send?access_token=******“ |
secret | N | Input/Output | the secret of DingTalk’s Webhook | “**“ |
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
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"
}'
Related links
- Basic schema for a Dapr component
- Bindings building block
- How-To: Trigger application with input binding
- How-To: Use bindings to interface with external resources
- Bindings API reference
Last modified September 17, 2021 : Merge pull request #1757 from georgestevens99/1440SecretKeyRefExplanation (620a5f8)