Get events and state around the specified event.
GET {{baseUrl}}/rooms/:roomId/context/:eventId?limit=3&filter=66696p746572
This API returns a number of events that happened just before and after the specified event. This allows clients to get the context surrounding an event.
Note: This endpoint supports lazy-loading of room member events. See Lazy-loading room members for more information.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
limit | number | The maximum number of events to return. Default: 10. | |
filter | string | A JSON RoomEventFilter to filter the returned events with. The | |
filter is only applied to events_before , events_after , and | |||
state . It is not applied to the event itself. The filter may | |||
be applied before or/and after the limit parameter - whichever the | |||
homeserver prefers. |
See Filtering for more information. |
RESPONSES
status: OK
{"end":"t29-57_2_0_2","events_after":[{"$ref":"../../event-schemas/examples/m.room.message$m.text.yaml"}],"event":{"$ref":"../../event-schemas/examples/m.room.message$m.image.yaml"},"events_before":[{"$ref":"../../event-schemas/examples/m.room.message$m.file.yaml"}],"start":"t27-54_2_0_2","state":[{"$ref":"../../event-schemas/examples/m.room.create.yaml"},{"$ref":"../../event-schemas/examples/m.room.member.yaml"}]}