live-chat
PATCH /v1/chat/widgets/{widgetId}
Change a chat's settings, or switch it on.
Аутентификация
API кілтін bearer токені ретінде жіберіңіз. Кілтте livechat.manage рұқсаты болуы тиіс; онсыз кілтке 404 емес, 403 қатесі қайтарылады.
Бұл соңғы нүкте ұйым идентификаторын қабылдамайды. Сіздің кілтіңіз оның қай ұйымға тиесілі екенін өзі анықтайды және жауап соған шектеледі.
Әрекет етіп көру
Бұрыштық жақшалардағы кез келген нәрсені өз мәндеріңізбен, ал кілт орналастырушысын басқару тақтасынан алынған кілтпен алмастырыңыз.
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.
Параметрлер
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
widgetId (path) | string | Иә | — |
Сұрау денесі
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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 | Жоқ | — |
Жауап
| Аты | Tүрі | Міндетті | Мазмұны |
|---|---|---|---|
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