Webhook 配置
Webhook 配置 API 允许管理 webhook 端点,以实时接收书写事件通知。每个 tenant 可以拥有多个 webhook 配置,从而将事件发送到不同的目的地。
数据模型
Webhook 配置
{
"configuration_key": "550e8400-e29b-41d4-a716-446655440000",
"tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"url": "https://example.com/webhook",
"headers": {
"Authorization": "Bearer token",
"X-Custom-Header": "value"
},
"hmac_signature_key": "secret-key"
}
创建 Webhook 配置 (POST)
Request
ENDPOINT
/outgoing_webhook/webhook_configurationMÉTODO
POSTRequest Body
{
"tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"url": "https://example.com/webhook",
"hmac_signature_key": "your-secret-key",
"headers": {
"Authorization": "Bearer token",
"X-Custom-Header": "value"
}
}
Request Body Params
| 字段 | 类型 | 描述 |
|---|---|---|
tenant_key* | string | tenant 的 UUID(UUID v4)。 |
url* | string | 接收 webhook 的目标 URL。 |
hmac_signature_key* | string | 用于 webhook HMAC 签名的密钥。 |
headers | object | 请求中要包含的自定义 headers。 |
Response
STATUS
201Response Body
{
"configuration_key": "550e8400-e29b-41d4-a716-446655440000",
"tenant_key": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"url": "https://example.com/webhook",
"headers": {
"Authorization": "Bearer token",
"X-Custom-Header": "value"
},
"hmac_signature_key": "your-secret-key"
}
Response Body Params
| 字段 | 类型 | 描述 |
|---|---|---|
configuration_key | string | webhook 配置的唯一键(UUID v4)。 |
tenant_key | string | tenant 的 UUID。 |
url | string | 已配置的目标 URL。 |
headers | object | 已配置的自定义 headers。 |
hmac_signature_key | string | HMAC 签名的密钥。 |