live-chat
PATCH /v1/chat/widgets/{widgetId}
Change a chat's settings, or switch it on.
Autenticación
Envía una clave de API como token de portador. La clave debe tener el permiso livechat.manage; una clave que no lo tenga se rechazará con un código 403, no 404.
Este endpoint no requiere ningún id de organización. Su clave ya identifica la organización a la que pertenece, y la respuesta está delimitada a ella.
Pruébalo
Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.
curl -X PATCH https://api.zinndigital.com/v1/chat/widgets/{widgetId} \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API
Detalles
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
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
widgetId (path) | string | Sí | — |
Cuerpo de la solicitud
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
name | string | No | — |
enabled | boolean | No | — |
allowed_origins | string[] | No | — |
greeting | string | No | — |
team_name | string | No | — |
accent_colour | string | No | — |
position | string<left, right> | No | — |
hide_branding | boolean | No | — |
ai_enabled | boolean | No | — |
offline_email | string | No | — |
business_hours | object | No | — |
Respuesta
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
id | string | Sí | — |
site_id | string | Sí | — |
name | string | Sí | — |
public_key | string | Sí | — |
enabled | boolean | Sí | 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[] | Sí | 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 | Sí | — |
greeting | string | Sí | — |
team_name | string | Sí | — |
accent_colour | string | Sí | — |
position | string<left, right> | Sí | — |
hide_branding | boolean | Sí | — |
ai_enabled | boolean | Sí | — |
offline_email | string | Sí | — |
business_hours | object | No | — |
open_now | boolean | Sí | — |
ai_allowance | ChatAiAllowance | Sí | — |
limits | object | Sí | — |
premium_extra_code | string | Sí | The catalogue code to buy for the premium tier. |
Errores que este endpoint puede devolver
401 · 403 · 404 · 422