notifications
PUT /v1/sites/{site_id}/notification-channels
Replace this site's notification channels.
المصادقة
أرسل مفتاح واجهة برمجة التطبيقات (API) كرمز حامل (bearer token). لا يحدد نقطة النهاية هذه إذنًا محددًا في المواصفات، لذا امنح مفتاحك الحد الأدنى الذي محتاجه وتحقق من الاستجابة بدلاً من الافتراض.
حيث يتم إدخال معرف مؤسستك
تأخذ نقطة النهاية هذه org_id كمعلمة استعلام. اتركه فارغاً ليغطي الاستدعاء شجرة مستأجريك بالكامل، أو أرسله لتضييق نطاق الاستدعاء ليشمل منظمة واحدة.
معرف مؤسستك موجود على شاشة مفاتيح واجهة برمجة التطبيقات (API) في لوحة تحكمك، بجوار المفتاح نفسه. وهو نفس المعرف في كل طلب تجريه.
جربه الآن
استبدل أي شيء بين أقواس زاوية بقيمك الخاصة، والعنصر النائب للمفتاح بمفتاح من لوحة تحكمك.
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
التفاصيل
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) | string | لا | The 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… |
جسم الطلب
| الاسم | النوع | مطلوب | ما هو هذا |
|---|---|---|---|
channels | SiteNotificationChannel[] | نعم | The COMPLETE set. Anything absent is removed. |
email_muted | boolean | لا | Ask 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_id | string | نعم | — |
channels | SiteNotificationChannel[] | نعم | — |
email_muted | boolean | نعم | What the customer ASKED for. Not necessarily what is happening. |
email_active | boolean | نعم | Whether 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_reason | string<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_alternatives | integer | لا | How many non-e-mail destinations this site routes to are delivering. |
overriding_choice | boolean | لا | True 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