live-chat
PATCH /v1/chat/widgets/{widgetId}
Change a chat's settings, or switch it on.
אימות
שלחו מפתח API כאסימון נושא (bearer token). על המפתח לכלול את הרשאה livechat.manage; מפתח שאינו כולל אותה יידחה בסטטוס 403, ולא 404.
נקודת קצה זו אינה דורשת מזהה ארגון. המפתח שלך כבר מזהה את הארגון שאליו הוא שייך, והתגובה מוגבלת אליו בלבד.
נסה זאת
החלף כל דבר בסוגריים זוויתיים בערכים משלך, ואת מציין מיקום המפתח במפתח מלוח הבקרה שלך.
curl -X PATCH https://api.zinndigital.com/v1/chat/widgets/{widgetId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'מחובר? קונסולת ה-API בלוח הבקרה שלך מזינה את מזהה הארגון האמיתי שלך ואת המפתח שלך, ומריצה את הבקשה מול ה-API הפיזי כך שתוכל לראות את התגובה בפועל. פתח נקודת קצה זו במסוף ה-API
פרטים
Requires `livechat.manage`. Switching a widget on with no `allowedOrigins` is refused with `422` rather than accepted: the widget only answers pages on origins the customer listed, so an empty list would leave the chat live, looking configured, and invisible on every page with nothing saying why.
פרמטרים
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
widgetId (path) | string | כן | — |
גוף הבקשה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
name | string | לא | — |
enabled | boolean | לא | — |
allowed_origins | string[] | לא | — |
greeting | string | לא | — |
team_name | string | לא | — |
accent_colour | string | לא | — |
position | string<left, right> | לא | — |
hide_branding | boolean | לא | — |
ai_enabled | boolean | לא | — |
offline_email | string | לא | — |
business_hours | object | לא | — |
תשובה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
id | string | כן | — |
site_id | string | כן | — |
name | string | כן | — |
public_key | string | כן | — |
enabled | boolean | כן | Whether the chat renders. Created FALSE always: the plugin ships in the deploy footprint of every WordPress site we host, so a widget may exist for a customer who never asked fo… |
allowed_origins | string[] | כן | Origins the widget may be embedded on. An EMPTY list refuses every page rather than allowing any — this is the only control stopping somebody else's site opening conversations a… |
tier | string | כן | — |
greeting | string | כן | — |
team_name | string | כן | — |
accent_colour | string | כן | — |
position | string<left, right> | כן | — |
hide_branding | boolean | כן | — |
ai_enabled | boolean | כן | — |
offline_email | string | כן | — |
business_hours | object | לא | — |
open_now | boolean | כן | — |
ai_allowance | ChatAiAllowance | כן | — |
limits | object | כן | — |
premium_extra_code | string | כן | The catalogue code to buy for the premium tier. |
שגיאות שנקודה קצה זו עשויה להחזיר
401 · 403 · 404 · 422