2016-07-12 18:22:33 +02:00
# 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.
2015-10-14 12:16:58 +02:00
swagger : '2.0'
info :
2015-12-04 12:09:35 +01:00
title : "Matrix Client-Server Rooms API"
2015-10-14 12:16:58 +02:00
version : "1.0.0"
host : localhost:8008
schemes :
- https
- http
2015-12-04 12:09:35 +01:00
basePath : /_matrix/client/%CLIENT_MAJOR_VERSION%
2015-10-14 12:16:58 +02:00
consumes :
- application/json
produces :
- application/json
securityDefinitions :
2016-05-03 14:57:16 +02:00
$ref : definitions/security.yaml
2015-10-14 12:16:58 +02:00
paths :
"/rooms/{roomId}/messages" :
get :
summary : Get a list of events for this room
description : |-
This API returns a list of message and state events for a room. It uses
pagination query parameters to paginate history in the room.
2017-08-03 01:19:34 +02:00
operationId : getRoomEvents
2015-10-14 12:16:58 +02:00
security :
- accessToken : [ ]
parameters :
- in : path
type : string
name : roomId
description : The room to get events from.
required : true
x-example : "!636q39766251:example.com"
- in : query
type : string
name : from
description : |-
The token to start returning events from. This token can be obtained
2016-07-13 05:38:53 +02:00
from a ``prev_batch`` token returned for each room by the sync API,
or from a ``start`` or ``end`` token returned by a previous request
to this endpoint.
2015-10-14 12:16:58 +02:00
required : true
x-example : "s345_678_333"
2016-07-13 05:38:53 +02:00
- in : query
type : string
name : to
description : |-
The token to stop returning events at. This token can be obtained from
a ``prev_batch`` token returned for each room by the sync endpoint,
or from a ``start`` or ``end`` token returned by a previous request to
this endpoint.
required : false
2015-10-14 12:16:58 +02:00
- in : query
type : string
enum : [ "b" , "f" ]
name : dir
description : |-
The direction to return events from.
required : true
x-example : "b"
- in : query
type : integer
name : limit
description : |-
The maximum number of events to return. Default : 10 .
x-example : "3"
2016-09-29 14:40:20 +02:00
- in : query
type : string
name : filter
description : |-
2016-09-30 16:06:11 +02:00
A JSON RoomEventFilter to filter returned events with.
x-example : |-
{"contains_url" : true }
2015-10-14 12:16:58 +02:00
responses :
200 :
description : A list of messages with a new token to request more.
schema :
type : object
description : A list of messages with a new token to request more.
properties :
start :
type : string
description : |-
2016-07-13 05:38:53 +02:00
The token the pagination starts from. If ``dir=b`` this will be
2015-10-14 12:16:58 +02:00
the token supplied in ``from``.
end :
type : string
description : |-
The token the pagination ends at. If ``dir=b`` this token should
be used again to request even earlier events.
chunk :
type : array
description : |-
2019-06-03 09:47:09 +02:00
A list of room events. The order depends on the ``dir`` parameter. For ``dir=b`` events will be in reverse-chronological order, for ``dir=f`` in chronological order, so that events start at the ``from`` point.
2015-10-14 12:16:58 +02:00
items :
type : object
title : RoomEvent
2018-05-03 16:18:47 +02:00
"$ref": "definitions/event-schemas/schema/core-event-schema/room_event.yaml"
2015-10-14 12:16:58 +02:00
examples :
2017-09-26 18:53:28 +02:00
application/json : {
2015-10-14 12:16:58 +02:00
"start": "t47429-4392820_219380_26003_2265" ,
"end": "t47409-4357353_219380_26003_2265" ,
"chunk": [
{
2019-05-29 22:56:42 +02:00
"room_id": "!636q39766251:example.com" ,
2019-05-29 23:23:45 +02:00
"$ref": "definitions/event-schemas/examples/m.room.message$m.text"
2015-10-14 12:16:58 +02:00
},
{
2019-05-29 22:56:42 +02:00
"room_id": "!636q39766251:example.com" ,
"$ref": "definitions/event-schemas/examples/m.room.name"
2015-10-14 12:16:58 +02:00
},
{
2019-05-29 22:56:42 +02:00
"room_id": "!636q39766251:example.com" ,
2019-05-29 23:23:45 +02:00
"$ref": "definitions/event-schemas/examples/m.room.message$m.video"
2015-10-14 12:16:58 +02:00
}
]
}
403 :
description : >
2015-10-14 18:02:39 +02:00
You aren't a member of the room.
2015-12-07 13:45:13 +01:00
tags :
- Room participation