GET /api/v1/chat/poll
Returns new messages since a given message ID. Use this endpoint for polling to keep the chat UI updated.
Authenticationβ
Optional. Works for both authenticated and anonymous sessions (identified by chat_session_id cookie).
Requestβ
| Parameter | Type | In | Description |
|---|---|---|---|
since_id | integer | query | Only return messages with ID greater than this value |
Exampleβ
curl -X GET "https://intotes.com/api/v1/chat/poll?since_id=3"
Responseβ
200 OKβ
{
"messages": [
{
"id": 4,
"sender": "support",
"text": "Your withdrawal has been processed and should arrive within 24 hours.",
"created_at": 1712238300000
}
]
}
Returns {"messages": []} if no new messages are available.
Note: created_at is returned as Unix milliseconds.
Errorsβ
| Status | Code | Description |
|---|---|---|
| 400 | β | Invalid since_id parameter |
| 401 | β | No chat_session_id cookie found |
| 500 | β | Server failed to poll messages |