live-chat
PATCH /v1/chat/widgets/{widgetId}
Change a chat's settings, or switch it on.
احراز هویت
یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز 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 for… |
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… |
tier | string | بله | The tier this widget is EFFECTIVELY on. Premium is included free with Zinn® hosting, so this may read premium on a widget nobody has paid for — read purchased_tier for what… |
tier_source | string<free, purchase, hosting> | بله | Why the widget is on that tier. hosting means it is included with the customer's Zinn® hosting and there is nothing to buy; purchase means the Premium extra was bought for… |
purchased_tier | string | بله | The tier actually PAID for, independent of any hosting inclusion. |
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