You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
162 lines
6.1 KiB
YAML
162 lines
6.1 KiB
YAML
# Copyright 2016 OpenMarket Ltd
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
openapi: 3.1.0
|
|
info:
|
|
title: Matrix Client-Server Event Context API
|
|
version: 1.0.0
|
|
paths:
|
|
"/rooms/{roomId}/context/{eventId}":
|
|
get:
|
|
summary: Get events and state around the specified event.
|
|
description: |-
|
|
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](/client-server-api/#lazy-loading-room-members) for more information.
|
|
operationId: getEventContext
|
|
security:
|
|
- accessTokenQuery: []
|
|
- accessTokenBearer: []
|
|
parameters:
|
|
- in: path
|
|
name: roomId
|
|
description: The room to get events from.
|
|
required: true
|
|
example: "!636q39766251:example.com"
|
|
schema:
|
|
type: string
|
|
- in: path
|
|
name: eventId
|
|
description: The event to get context around.
|
|
required: true
|
|
example: $f3h4d129462ha:example.com
|
|
schema:
|
|
type: string
|
|
- in: query
|
|
name: limit
|
|
description: |-
|
|
The maximum number of context events to return. The limit applies
|
|
to the sum of the `events_before` and `events_after` arrays. The
|
|
requested event ID is always returned in `event` even if `limit` is
|
|
0. Defaults to 10.
|
|
example: 3
|
|
schema:
|
|
type: integer
|
|
- in: query
|
|
name: filter
|
|
description: |-
|
|
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](/client-server-api/#filtering) for more information.
|
|
example: 66696p746572
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: The events and state surrounding the requested event.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
description: The events and state surrounding the requested event.
|
|
properties:
|
|
start:
|
|
type: string
|
|
description: A token that can be used to paginate backwards with.
|
|
end:
|
|
type: string
|
|
description: A token that can be used to paginate forwards with.
|
|
events_before:
|
|
type: array
|
|
description: |-
|
|
A list of room events that happened just before the
|
|
requested event, in reverse-chronological order.
|
|
items:
|
|
$ref: definitions/client_event.yaml
|
|
event:
|
|
description: Details of the requested event.
|
|
allOf:
|
|
- $ref: definitions/client_event.yaml
|
|
events_after:
|
|
type: array
|
|
description: |-
|
|
A list of room events that happened just after the
|
|
requested event, in chronological order.
|
|
items:
|
|
$ref: definitions/client_event.yaml
|
|
state:
|
|
type: array
|
|
description: The state of the room at the last event returned.
|
|
items:
|
|
$ref: definitions/client_event.yaml
|
|
examples:
|
|
response:
|
|
value: {
|
|
"end": "t29-57_2_0_2",
|
|
"events_after": [
|
|
{
|
|
"room_id": "!636q39766251:example.com",
|
|
"$ref": "../../event-schemas/examples/m.room.message$m.text.yaml"
|
|
}
|
|
],
|
|
"event": {
|
|
"event_id": "$f3h4d129462ha:example.com",
|
|
"room_id": "!636q39766251:example.com",
|
|
"$ref": "../../event-schemas/examples/m.room.message$m.image.yaml"
|
|
},
|
|
"events_before": [
|
|
{
|
|
"room_id": "!636q39766251:example.com",
|
|
"$ref": "../../event-schemas/examples/m.room.message$m.file.yaml"
|
|
}
|
|
],
|
|
"start": "t27-54_2_0_2",
|
|
"state": [
|
|
{
|
|
"room_id": "!636q39766251:example.com",
|
|
"$ref": "../../event-schemas/examples/m.room.create.yaml"
|
|
},
|
|
{
|
|
"room_id": "!636q39766251:example.com",
|
|
"$ref": "../../event-schemas/examples/m.room.member.yaml"
|
|
}
|
|
]
|
|
}
|
|
tags:
|
|
- Room participation
|
|
servers:
|
|
- url: "{protocol}://{hostname}{basePath}"
|
|
variables:
|
|
protocol:
|
|
enum:
|
|
- http
|
|
- https
|
|
default: https
|
|
hostname:
|
|
default: localhost:8008
|
|
basePath:
|
|
default: /_matrix/client/v3
|
|
components:
|
|
securitySchemes:
|
|
accessTokenQuery:
|
|
$ref: definitions/security.yaml#/accessTokenQuery
|
|
accessTokenBearer:
|
|
$ref: definitions/security.yaml#/accessTokenBearer
|