Stream the journal entries after a given one
const url = 'https://chat.work.optidata.cloud/api/chats/36/wal/since/0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://chat.work.optidata.cloud/api/chats/36/wal/since/0 \ --header 'Authorization: Bearer <token>'Every entry appended after {id}, oldest first, streamed as a single JSON
document. This is the polling call of a journal follower: keep the highest
id you have applied, ask for what came after it, apply the entries in
order, and remember the new highest id.
The server caps how many entries one call returns. When you get a full batch, call again from the last id you received rather than assuming you are caught up.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Numeric id of the conversation.
Id of the last journal entry you already hold. Use 0 to start from the beginning.
Responses
Section titled “ Responses ”The journal entries appended after the given id.
object
One append-only entry of a conversation’s change journal. event_class
names the kind of change and event_json carries its payload; entries are
applied in ascending id order.
object
Monotonic position in the journal. Pass it to since/{id}.
The message the entry is about.
The client session that caused the change. Compare it with your own to skip the echo of your own writes.
The kind of change this entry records.
The payload of the change.
Examples
Nothing new
{ "entries": []}Missing, malformed or expired authentication key.
Authentication failures — and a few permission denials — use an error
key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller is not a participant of the conversation, or lacks the role the operation requires.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "This action is unauthorized."}The resource does not exist, or does not belong to the given conversation.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "No query results for model [App\\Models\\Chat\\Chat] 99999999"}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}