public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
Kimlik Doğrulama
Bu uç nokta arakatmana açıktır. Kimlik bilgisi ve organizasyon gerektirmez; kendi pazarlama sitemizin ve yapay zeka yanıt motorlarımızın okuduğu yerdir.
Bu uç nokta hiçbir organizasyon kimliği almaz. Anahtarınız zaten ait olduğu organizasyonu tanımlar ve yanıt bu organizasyonla sınırlandırılır.
Dene
Köşeli parantez içindeki her şeyi kendi değerlerinizle ve anahtar yer tutucusunu panonuzdan bir anahtarla değiştirin.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'Oturum açtınız mı? Panonuzdaki API konsolu, gerçek organizasyon kimliğinizi ve kendi anahtarınızı otomatik olarak doldurur ve isteği canlı API üzerinde çalıştırarak gerçek yanıtı görmenizi sağlar. Bu uç noktayı API konsolunda açın
Ayrıntılar
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.
Parametreler
| Ad | Tür | Zorunlu | Ne olduğu |
|---|---|---|---|
publicKey (path) | string | Evet | 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… |
İstek gövdesi
| Ad | Tür | Zorunlu | Ne olduğu |
|---|---|---|---|
message | string | Evet | — |
page_url | string | Hayır | — |
page_title | string | Hayır | — |
referrer | string | Hayır | — |
locale | string | Hayır | — |
name | string | Hayır | — |
email | string | Hayır | — |
Yanıt
| Ad | Tür | Zorunlu | Ne olduğu |
|---|---|---|---|
state | string<ai, waiting, open, offline, closed> | Evet | — |
cursor | integer | Evet | — |
poll_after_ms | integer | Evet | 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[] | Evet | — |
conversation_id | string | Evet | — |
visitor_token | string | Evet | 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… |
Bu uç noktanın dönderebileceği hatalar
404 · 422 · 429