public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
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ázev | Typ | Požadováno | Co to je |
|---|---|---|---|
publicKey (path) | string | Ano | The 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ázev | Typ | Požadováno | Co to je |
|---|---|---|---|
message | string | Ano | — |
page_url | string | Ne | — |
page_title | string | Ne | — |
referrer | string | Ne | — |
locale | string | Ne | — |
name | string | Ne | — |
email | string | Ne | — |
Odpověď
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
state | string<ai, waiting, open, offline, closed> | Ano | — |
cursor | integer | Ano | — |
poll_after_ms | integer | Ano | How 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… |
messages | ChatMessage[] | Ano | — |
conversation_id | string | Ano | — |
visitor_token | string | Ano | Returned 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