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 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