notifications

PUT /v1/sites/{site_id}/notification-channels

Replace this site's notification channels.

所有 notifications 端点

所有开发者文档

身份验证

请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。

您的组织 ID 应填在此处

此端点将 org_id 作为查询参数。不填则调用涵盖您的整个租户子树;发送该参数则将调用范围缩小到一个组织。

您的组织ID位于控制面板的API密钥屏幕上,就在密钥本身的旁边。这是您在每次调用时使用的相同ID。

免费试用

将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。

curl -X PUT https://api.zinndigital.com/v1/sites/{site_id}/notification-channels \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "channels": <SiteNotificationChannel[]> }'

已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点

详细信息

The COMPLETE desired routing, sent as one document. A channel absent from the list is one the customer removed - a POST-only surface could not express removal, and the screen is a matrix the customer edits in several places before pressing save once. Refused 422 when email_muted is true and no listed destination is a non-e-mail channel that is verified and delivering. The check runs against the routing you are ABOUT to save, not the current one, so "connect Slack and turn e-mail off" works in a single request. It is refused at the point of asking rather than accepted and ignored: a toggle that accepts a value it will not honour reads as a broken setting.

参数

名称类型必填内容简介
site_id (path)string
org_id (query)stringThe organization to act on. Omitted resolves to your own ONLY when you belong to exactly one organisation; a principal in more than one must name it. A reseller managing a client…

请求正文

名称类型必填内容简介
channelsSiteNotificationChannel[]The COMPLETE set. Anything absent is removed.
email_mutedbooleanAsk for e-mail to be switched off. Refused 422 unless at least one listed destination is a non-e-mail channel that is verified and delivering.

响应

名称类型必填内容简介
site_idstring
channelsSiteNotificationChannel[]
email_mutedbooleanWhat the customer ASKED for. Not necessarily what is happening.
email_activebooleanWhether e-mail is actually being sent right now. Computed at send time from the live health of the other channels, never read from a stored flag.
email_reasonstring<not_muted, muted, alternatives_failing, no_alternative, unreadable>Why. not_muted - the customer never turned it off. muted - off, as asked, with a healthy alternative. alternatives_failing - back ON because their other channels have…
healthy_alternativesintegerHow many non-e-mail destinations this site routes to are delivering.
overriding_choicebooleanTrue when e-mail is being sent DESPITE the customer having muted it. This is the state a screen must explain, or the toggle appears broken.

此端点可能返回的错误

422