Webhook
注册 webhook
注册 Sofia 以带签名 JSON 事件调用的 https URL,失败最多重试五次。密钥仅显示一次,最多 10 个。
授权
Authorizationstring必填你的个人密钥或 OAuth 访问令牌,以
Bearer <token>发送。
请求体
application/json
urlstring必填Sofia 调用的 https 地址。解析到私有、回环或链路本地地址的主机会被拒绝
eventsstring[]必填要接收的事件
响应
201application/json
webhook 及其签名密钥,仅显示一次。
idstring必填webhook 的标识符
urlstring必填Sofia 调用的地址
eventsstring[]必填已订阅的事件
createdAtstring<date-time>必填webhook 的注册时间
secretstring必填为每次投递签名的 HMAC-SHA256 密钥(
Sofia-Signature)。仅此一次显示
400
webhook_url_invalid:不是 https,或是私有、回环或链路本地主机。webhook_event_invalid:未知事件,或没有事件。
401
令牌缺失、未知、已过期或已被撤销。
403
令牌没有 webhooks:write scope。
409
webhook_limit_reached:已有 10 个 webhook。
4XXapplication/json
其他任何错误,以错误结构返回。