public
POST /v1/public/chat/{publicKey}/conversations
A visitor says something for the first time.
المصادقة
هذه نقطة النهاية عامة. فهي لا تتطلب أي بيانات اعتماد ولا أي مؤسسة - بل هي ما تقرؤه مواقعنا التسويقية ومحركات الإجابة بالذكاء الاصطناعي الخاصة بنا.
لا يقبل هذا الطرف أي معرف للمؤسسة. يحدد مفتاحك بالفعل المؤسسة التي ينتمي إليها، وتكون الاستجابة محصورة في نطاقها.
جربه الآن
استبدل أي شيء بين أقواس زاوية بقيمك الخاصة، والعنصر النائب للمفتاح بمفتاح من لوحة تحكمك.
curl -X POST https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations \
-H "Content-Type: application/json" \
-d '{ "message": <string> }'هل سجلت الدخول؟ تقوم وحدة تحكم واجهة برمجة التطبيقات في لوحة التحكم الخاصة بك بربط معرف مؤسستك الحقيقي ومفتاحك الخاص، وتنفذ الطلب مقابل واجهة برمجة التطبيقات المباشرة لتتمكن من رؤية الاستجابة الفعلية. افتح هذه النهاية الطرفية في وحدة تحكم 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