notifications

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

Replace this site's notification channels.

Tất cả các điểm cuối notifications

Tất cả tài liệu dành cho nhà phát triển

Xác thực

Gửi khóa API dưới dạng mã thông báo bearer. Điểm cuối này không nêu rõ quyền cụ thể trong thông số kỹ thuật, vì vậy hãy cấp cho khóa của bạn quyền tối thiểu cần thiết và kiểm tra phản hồi thay vì phỏng đoán.

Nơi điền id tổ chức của bạn

Điểm cuối này nhận org_id làm tham số truy vấn. Hãy bỏ trống để áp dụng cho toàn bộ cây thuê của bạn; hoặc truyền giá trị vào để thu hẹp phạm vi gọi về một tổ chức duy nhất.

Mã tổ chức của bạn nằm ở màn hình khóa API trong bảng điều khiển, ngay bên cạnh khóa đó. Đây là cùng một mã trong mọi lệnh gọi mà bạn thực hiện.

Dùng thử

Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.

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[]> }'

Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API

Chi tiết

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.

Tham số

TênLoạiBắt buộcNội dung này là gì
site_id (path)string
org_id (query)stringKhôngThe 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…

Nội dung yêu cầu

TênLoạiBắt buộcNội dung này là gì
channelsSiteNotificationChannel[]The COMPLETE set. Anything absent is removed.
email_mutedbooleanKhôngAsk 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.

Phản hồi

TênLoạiBắt buộcNội dung này là gì
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_alternativesintegerKhôngHow many non-e-mail destinations this site routes to are delivering.
overriding_choicebooleanKhôngTrue 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.

Các lỗi điểm cuối này có thể trả về

422