live-chat
PATCH /v1/chat/widgets/{widgetId}
Change a chat's settings, or switch it on.
Autenticação
Envie uma chave de API como um token de portador. A chave deve ter a permissão livechat.manage; uma chave sem ela é recusada com 403, e não 404.
Este endpoint não requer um ID de organização. Sua chave já identifica a organização à qual pertence, e a resposta é delimitada a ela.
Experimente
Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.
curl -X PATCH https://api.zinndigital.com/v1/chat/widgets/{widgetId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API
Detalhes
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.
Parâmetros
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
widgetId (path) | string | Sim | — |
Corpo da requisição
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
name | string | Não | — |
enabled | boolean | Não | — |
allowed_origins | string[] | Não | — |
greeting | string | Não | — |
team_name | string | Não | — |
accent_colour | string | Não | — |
position | string<left, right> | Não | — |
hide_branding | boolean | Não | — |
ai_enabled | boolean | Não | — |
offline_email | string | Não | — |
business_hours | object | Não | — |
Resposta
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
id | string | Sim | — |
site_id | string | Sim | — |
name | string | Sim | — |
public_key | string | Sim | — |
enabled | boolean | Sim | 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[] | Sim | 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 | Sim | — |
greeting | string | Sim | — |
team_name | string | Sim | — |
accent_colour | string | Sim | — |
position | string<left, right> | Sim | — |
hide_branding | boolean | Sim | — |
ai_enabled | boolean | Sim | — |
offline_email | string | Sim | — |
business_hours | object | Não | — |
open_now | boolean | Sim | — |
ai_allowance | ChatAiAllowance | Sim | — |
limits | object | Sim | — |
premium_extra_code | string | Sim | The catalogue code to buy for the premium tier. |
Erros que este endpoint pode retornar
401 · 403 · 404 · 422