13.8
发送 Webhook 消息
POST
/<guild_id>/api/tickets/<ticket_id>/webhook-message以 Webhook 样式向工单频道发送一条消息。适合发布自动通知、状态更新,或来自外部系统的消息。
请求体
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| content | string | 可选 | 纯文本的消息内容。 |
| embed_title | string | 可选 | 可选嵌入消息的标题。 |
| embed_description | string | 可选 | 嵌入消息的描述正文。 |
| embed_color | string | 可选 | 嵌入消息的颜色,可用十六进制字符串或 Discord 颜色名称。 |
| username | string | 可选 | 覆盖 Webhook 显示的用户名。 |
| avatar | string | 可选 | 用图片 URL 覆盖 Webhook 的头像。 |
content、embed_title、embed_description 三者至少要填一个。其余字段都是可选的,省略时会使用默认值。
请求示例
curl -X POST \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"content":"Deployment complete","embed_title":"Status Update","embed_description":"v2.4.1 is now live","embed_color":"#5865F2","username":"Deploy Bot"}' \
https://api.ticketsx.xyz/<guild_id>/api/tickets/<ticket_id>/webhook-message响应示例
{
"success": true,
"message_id": "1234567890123456789"
}