public

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

A visitor says something for the first time.

Wszystkie punkty końcowe public

Wszystkie dokumentacje dla programistów

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

NazwaTypWymaganeCo to jest
publicKey (path)stringTakThe 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

NazwaTypWymaganeCo to jest
messagestringTak
page_urlstringNie
page_titlestringNie
referrerstringNie
localestringNie
namestringNie
emailstringNie

Odpowiedź

NazwaTypWymaganeCo to jest
statestring<ai, waiting, open, offline, closed>Tak
cursorintegerTak
poll_after_msintegerTakHow 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[]Tak
conversation_idstringTak
visitor_tokenstringTakReturned 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