live-chat
POST /v1/chat/widgets
Create a chat for a site.
احراز هویت
یک کلید API را به عنوان یک توکن حامل ارسال کنید. این کلید باید دارای مجوز livechat.manage باشد؛ کلیدی که فاقد آن باشد با خطای 403 رد میشود، نه 404.
جایی که شناسه سازمان شما قرار میگیرد
این نقطه پایانی org_id را به عنوان یک فیلد در بدنه JSON دریافت میکند.
شناسه سازمان شما در صفحه کلیدهای API در داشبوردتان، در کنار خود کلید قرار دارد. این شناسه در تمام درخواستهایی که ارسال میکنید یکسان است.
امتحان کنید
هر چیزی را که داخل براکتهای زاویهدار قرار دارد با مقادیر خودتان جایگزین کنید، و نگهدارنده کلید را با کلیدی از داشبورد خود جایگزین نمایید.
curl -X POST https://api.zinndigital.com/v1/chat/widgets \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string> }'وارد شدهاید؟ کنسول API در داشبورد شما شناسه سازمان واقعی و کلید خودتان را پر میکند و درخواست را روی API زنده اجرا میکند تا بتوانید پاسخ واقعی را ببینید. این نقطه پایانی را در کنسول API باز کنید
جزئیات
Requires livechat.manage. The new widget is created switched off: a chat window that starts talking to a customer's visitors before they have asked for one is a consent problem, not a feature.
بدنه درخواست
| نام | نوع | الزامی | چیست |
|---|---|---|---|
org_id | string | خیر | — |
site_id | string | خیر | — |
name | string | بله | — |
team_name | string | خیر | — |
allowed_origins | string[] | خیر | — |
پاسخ
| نام | نوع | الزامی | چیست |
|---|---|---|---|
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 · 422