live-chat

PATCH /v1/chat/widgets/{widgetId}

Change a chat's settings, or switch it on.

Všechny koncové body live-chat

Všechny dokumenty pro vývojáře

Autentizace

Zašlete API klíč jako nosný token (bearer token). Klíč musí mít oprávnění livechat.manage; klíč bez něj je odmítnut s kódem 403, nikoli 404.

Tento koncový bod nevyžaduje žádné ID organizace. Váš klíč již identifikuje organizaci, ke které patří, a odpověď je na ni omezena.

Vyzvednout

Nahraďte cokoli v závorkách vlastními hodnotami a zástupný symbol klíče klíčem z vašeho řídicího panelu.

curl -X PATCH https://api.zinndigital.com/v1/chat/widgets/{widgetId} \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

Přihlášeni? Konzole API ve vašem dashboardu automaticky doplní vaše skutečné ID organizace i váš vlastní klíč a odešle požadavek na živé API, abyste viděli reálnou odpověď. Otevřete tento koncový bod v konzoli API

Podrobnosti

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.

Parametry

NázevTypPožadovánoCo to je
widgetId (path)stringAno

Tělo požadavku

NázevTypPožadovánoCo to je
namestringNe
enabledbooleanNe
allowed_originsstring[]Ne
greetingstringNe
team_namestringNe
accent_colourstringNe
positionstring<left, right>Ne
hide_brandingbooleanNe
ai_enabledbooleanNe
offline_emailstringNe
business_hoursobjectNe

Odpověď

NázevTypPožadovánoCo to je
idstringAno
site_idstringAno
namestringAno
public_keystringAno
enabledbooleanAnoWhether 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_originsstring[]AnoOrigins 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…
tierstringAnoThe 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_sourcestring<free, purchase, hosting>AnoWhy 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_tierstringAnoThe tier actually PAID for, independent of any hosting inclusion.
greetingstringAno
team_namestringAno
accent_colourstringAno
positionstring<left, right>Ano
hide_brandingbooleanAno
ai_enabledbooleanAno
offline_emailstringAno
business_hoursobjectNe
open_nowbooleanAno
ai_allowanceChatAiAllowanceAno
limitsobjectAno
premium_extra_codestringAnoThe catalogue code to buy for the premium tier.

Chyby, které může tento koncový bod vrátit

401 · 403 · 404 · 422