public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
אימות
נקודת קצה זו היא ציבורית. היא אינה דורשת שורת פרטי זיהוי ואינה דורשת ארגון – זהו המידע שאתרי השיווק ומנועי התשובות מבוססי ה-AI שלנו קוראים.
נקודת קצה זו אינה דורשת מזהה ארגון. המפתח שלך כבר מזהה את הארגון שאליו הוא שייך, והתגובה מוגבלת אליו בלבד.
נסה זאת
החלף כל דבר בסוגריים זוויתיים בערכים משלך, ואת מציין מיקום המפתח במפתח מלוח הבקרה שלך.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'מחובר? קונסולת ה-API בלוח הבקרה שלך מזינה את מזהה הארגון האמיתי שלך ואת המפתח שלך, ומריצה את הבקשה מול ה-API הפיזי כך שתוכל לראות את התגובה בפועל. פתח נקודת קצה זו במסוף ה-API
פרטים
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.
פרמטרים
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
publicKey (path) | string | כן | 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… |
גוף הבקשה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
message | string | כן | — |
page_url | string | לא | — |
page_title | string | לא | — |
referrer | string | לא | — |
locale | string | לא | — |
name | string | לא | — |
email | string | לא | — |
תשובה
| שם | סוג | נדרש | מה זה |
|---|---|---|---|
state | string<ai, waiting, open, offline, closed> | כן | — |
cursor | integer | כן | — |
poll_after_ms | integer | כן | 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[] | כן | — |
conversation_id | string | כן | — |
visitor_token | string | כן | 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… |
שגיאות שנקודה קצה זו עשויה להחזיר
404 · 422 · 429