Page through a conversation's change journal
const url = 'https://chat.work.optidata.cloud/api/chats/36/wal?page=1';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?page=1' \ --header 'Authorization: Bearer <token>'Every conversation keeps a write-ahead journal: one append-only entry per change to its messages, each carrying the event class and its payload. An integration that follows the journal can keep an external copy of the conversation up to date without re-reading the message history.
This operation pages through the journal from the beginning. To follow it
live, read latest once and then poll since/{id}.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Numeric id of the conversation.
Query Parameters
Section titled “Query Parameters”1-based page number.
Responses
Section titled “ Responses ”A page of journal entries.
object
Navigation links of a paginated envelope.
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.
Example
{ "current_page": 1}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."}