public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
Uwierzytelnianie
Ten punkt końcowy jest publiczny. Nie wymaga żadnych poświadczeń ani organizacji — to z niego korzysta nasza własna strona marketingowa oraz silniki odpowiedzi AI.
Ten punkt końcowy nie wymaga identyfikatora organizacji. Twój klucz już identyfikuje organizację, do której należy, a odpowiedź jest do niej ograniczona.
Wypróbuj
Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API
Szczegóły
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
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
publicKey (path) | string | Tak | 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… |
Treść żądania
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
message | string | Tak | — |
page_url | string | Nie | — |
page_title | string | Nie | — |
referrer | string | Nie | — |
locale | string | Nie | — |
name | string | Nie | — |
email | string | Nie | — |
Odpowiedź
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
state | string<ai, waiting, open, offline, closed> | Tak | — |
cursor | integer | Tak | — |
poll_after_ms | integer | Tak | 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[] | Tak | — |
conversation_id | string | Tak | — |
visitor_token | string | Tak | 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… |
Błędy, które ten punkt końcowy może zwrócić
404 · 422 · 429