You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/webhook-config.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,29 @@ When using the Form-Encoded or JSON-Encoded configuration you can configure any
80
80
81
81
The result would be a POST request with e.g. `Status: running` body and `Content-Type: text/plain` header.
82
82
83
+
### Nested Webhook Configuration
84
+
85
+
Some webhook targets require a nested structure.
86
+
This can be accomplished by setting the content as dictionary or list instead of as text directly.
87
+
88
+
This is only supported for the JSON format.
89
+
90
+
```json
91
+
"webhook": {
92
+
"enabled": true,
93
+
"url": "https://<yourhookurl>",
94
+
"format": "json",
95
+
"status": {
96
+
"msgtype": "text",
97
+
"text": {
98
+
"content": "Status update: {status}"
99
+
}
100
+
}
101
+
}
102
+
```
103
+
104
+
The result would be a POST request with e.g. `{"msgtype":"text","text":{"content":"Status update: running"}}` body and `Content-Type: application/json` header.
105
+
83
106
## Additional configurations
84
107
85
108
The `webhook.retries` parameter can be set for the maximum number of retries the webhook request should attempt if it is unsuccessful (i.e. HTTP response status is not 200). By default this is set to `0` which is disabled. An additional `webhook.retry_delay` parameter can be set to specify the time in seconds between retry attempts. By default this is set to `0.1` (i.e. 100ms). Note that increasing the number of retries or retry delay may slow down the trader if there are connectivity issues with the webhook.
0 commit comments