Skip to content

Commit aad2119

Browse files
committed
docs: document nested webhook functionality
1 parent 739a67f commit aad2119

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/webhook-config.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,29 @@ When using the Form-Encoded or JSON-Encoded configuration you can configure any
8080

8181
The result would be a POST request with e.g. `Status: running` body and `Content-Type: text/plain` header.
8282

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+
83106
## Additional configurations
84107

85108
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

Comments
 (0)