public
POST /v1/public/chat/{publicKey}/conversations/{conversationId}/messages
The visitor says something else.
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/{conversationId}/messages \
-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, authorised by X-Zinn-Chat-Token. The message is written to the database in this request, before any operator or assistant is involved — so nothing is lost when a consumer is down. A visitor writing into a conversation the operator had closed reopens it rather than being told it is over.
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… |
conversationId (path) | string | Evet | — |
İ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 | — |
Bu uç noktanın dönderebileceği hatalar
404 · 422 · 429