public

POST /v1/public/chat/{publicKey}/conversations

A visitor says something for the first time.

Všechny koncové body public

Všechny dokumenty pro vývojáře

Autentizace

Tento koncový bod je veřejný. Nevyžaduje žádná pověření ani organizaci – je to to, co čte náš vlastní marketingový web a naše AI vyhledávače.

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 POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
  -H "Content-Type: application/json" \
  -d '{ "message": <string> }'

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

Anonymous. Opens a conversation and writes the visitor's first message, then lets the assistant answer it inline if the customer has AI switched on. The response carries a visitorToken once and never again. It is a bearer secret — the only thing standing between one visitor and another's transcript on the same site — so the widget keeps it in the visitor's own storage and presents it in X-Zinn-Chat-Token on every subsequent call. It is never accepted in a query string, because a query string is written to every access log.

Parametry

NázevTypPožadovánoCo to je
publicKey (path)stringAnoThe widget's public key. Public by design — it ships in the page source of every site that embeds the widget — so it NAMES a widget and authorises nothing; the Origin header is…

Tělo požadavku

NázevTypPožadovánoCo to je
messagestringAno
page_urlstringNe
page_titlestringNe
referrerstringNe
localestringNe
namestringNe
emailstringNe

Odpověď

NázevTypPožadovánoCo to je
statestring<ai, waiting, open, offline, closed>Ano
cursorintegerAno
poll_after_msintegerAnoHow long the widget should wait before asking again. Decided by the SERVER on every response, because a cadence baked into the widget is cached on somebody else's site behind…
messagesChatMessage[]Ano
conversation_idstringAno
visitor_tokenstringAnoReturned ONCE and never again. A bearer secret — the only thing between one visitor and another's transcript on the same site — presented afterwards in X-Zinn-Chat-Token, never…

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

404 · 422 · 429