public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
Autentifikacija
Ova je krajnja točka javna. Ne zahtijeva nikakve vjerodajnice ni organizaciju – to je ono što čitaju naše vlastite marketinške stranice i AI strojevi za odgovore.
Ova krajnja točka ne prihvaća ID organizacije. Vaš ključ već identificira organizaciju kojoj pripada, a odgovor je ograničen na nju.
Isprobajte
Zamijenite sve unutar šiljastih zagrada svojim vlastitim vrijednostima, a rezervirano mjesto za ključ s ključem iz vaše nadzorne ploče.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'Prijavljeni ste? API konzola na vašoj nadzornoj ploči automatski unosi stvarni ID vaše organizacije i vaš vlastiti ključ te šalje zahtjev prema aktivnom API-ju kako biste mogli vidjeti stvarni odgovor. Otvori ovu krajnju točku u API konzoli
Pojedinosti
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.
Parametri
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
publicKey (path) | string | Da | 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… |
Tijelo zahtjeva
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
message | string | Da | — |
page_url | string | Ne | — |
page_title | string | Ne | — |
referrer | string | Ne | — |
locale | string | Ne | — |
name | string | Ne | — |
email | string | Ne | — |
Odgovor
| Naziv | Vrsta | Obavezno | Što je to |
|---|---|---|---|
state | string<ai, waiting, open, offline, closed> | Da | — |
cursor | integer | Da | — |
poll_after_ms | integer | Da | 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[] | Da | — |
conversation_id | string | Da | — |
visitor_token | string | Da | 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… |
Pogreške koje ova krajnja točka može vratiti
404 · 422 · 429