public
GET /v1/public/chat/{publicKey}/conversations/{conversationId}/messages
Anything said since the visitor's cursor.
Xác thực
Điểm cuối này là công khai. Nó không yêu cầu thông tin xác thực hay tổ chức nào — đây chính là nội dung mà trang web tiếp thị và các công cụ trả lời bằng AI của chúng tôi đọc.
Endpoint này không nhận ID tổ chức. Khóa của bạn đã xác định tổ chức mà nó thuộc về và phản hồi được giới hạn trong phạm vi đó.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X GET https://api.zinndigital.com/v1/public/chat/{publicKey}/conversations/{conversationId}/messagesĐã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
Anonymous, authorised by X-Zinn-Chat-Token. Returns immediately — empty if there is nothing — and tells the caller when to ask again in pollAfterMs. ⛔ This endpoint does not hold the connection open, and no future version of it should. The engine is WSGI with a small fixed number of concurrent request slots, so a long-poll or an SSE stream here would consume a share of the entire platform's capacity per open chat. When concurrency outgrows short-polling, chat moves to its own ASGI service — it does not become a socket on this one. ⭐ pollAfterMs is decided by the server, never by the widget. A cadence baked into a JavaScript file is cached on somebody else's site behind somebody else's CDN, so the one number governing fleet-wide load would be the one number we could not change.
Tham số
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
publicKey (path) | string | Có | 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 | Có | — |
after (query) | integer | Không | The highest seq the caller already has. A per-conversation counter, not a timestamp: two messages written in the same millisecond are indistinguishable by clock, so a time… |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
state | string<ai, waiting, open, offline, closed> | Có | — |
cursor | integer | Có | — |
poll_after_ms | integer | Có | 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[] | Có | — |
Các lỗi điểm cuối này có thể trả về
404 · 429