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.
106 lines
3.5 KiB
YAML
106 lines
3.5 KiB
YAML
9 years ago
|
swagger: '2.0'
|
||
|
info:
|
||
9 years ago
|
title: "Matrix Client-Server Sync Guest API"
|
||
9 years ago
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
|
- http
|
||
9 years ago
|
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||
9 years ago
|
consumes:
|
||
|
- application/json
|
||
|
produces:
|
||
|
- application/json
|
||
|
securityDefinitions:
|
||
|
accessToken:
|
||
|
type: apiKey
|
||
|
description: The user_id or application service access_token
|
||
|
name: access_token
|
||
|
in: query
|
||
|
paths:
|
||
|
"/events":
|
||
|
get:
|
||
|
summary: Listen on the event stream.
|
||
|
description: |-
|
||
|
This will listen for new events related to a particular room and return
|
||
|
them to the caller. This will block until an event is received, or until
|
||
|
the ``timeout`` is reached.
|
||
|
|
||
9 years ago
|
This API is the same as the normal ``/events`` endpoint, but can be
|
||
|
called by users who have not joined the room.
|
||
9 years ago
|
|
||
9 years ago
|
Note that the normal ``/events`` endpoint has been deprecated. This
|
||
9 years ago
|
API will also be deprecated at some point, but its replacement is not
|
||
|
yet known.
|
||
9 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: query
|
||
|
type: string
|
||
|
name: from
|
||
|
description: |-
|
||
|
The token to stream from. This token is either from a previous
|
||
|
request to this API or from the initial sync API.
|
||
|
required: false
|
||
|
x-example: "s3456_9_0"
|
||
|
- in: query
|
||
|
type: integer
|
||
|
name: timeout
|
||
|
description: The maximum time in milliseconds to wait for an event.
|
||
|
required: false
|
||
|
x-example: "35000"
|
||
|
- in: query
|
||
9 years ago
|
type: string
|
||
9 years ago
|
name: room_id
|
||
|
description: |-
|
||
9 years ago
|
The room ID for which events should be returned.
|
||
9 years ago
|
x-example:
|
||
9 years ago
|
- "!somewhere:over.the.rainbow"
|
||
9 years ago
|
responses:
|
||
|
200:
|
||
|
description: "The events received, which may be none."
|
||
|
examples:
|
||
|
application/json: |-
|
||
|
{
|
||
|
"start": "s3456_9_0",
|
||
|
"end": "s3457_9_0",
|
||
|
"chunk": [
|
||
|
{
|
||
|
"age": 32,
|
||
|
"content": {
|
||
|
"body": "incoming message",
|
||
|
"msgtype": "m.text"
|
||
|
},
|
||
|
"event_id": "$14328055551tzaee:localhost",
|
||
|
"origin_server_ts": 1432804485886,
|
||
|
"room_id": "!TmaZBKYIFrIPVGoUYp:localhost",
|
||
|
"type": "m.room.message",
|
||
9 years ago
|
"sender": "@bob:localhost"
|
||
9 years ago
|
}
|
||
|
]
|
||
|
}
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
start:
|
||
|
type: string
|
||
|
description: |-
|
||
|
A token which correlates to the first value in ``chunk``. This
|
||
|
is usually the same token supplied to ``from=``.
|
||
|
end:
|
||
|
type: string
|
||
|
description: |-
|
||
|
A token which correlates to the last value in ``chunk``. This
|
||
|
token should be used in the next request to ``/events``.
|
||
|
chunk:
|
||
|
type: array
|
||
|
description: "An array of events."
|
||
|
items:
|
||
|
type: object
|
||
|
title: Event
|
||
|
allOf:
|
||
9 years ago
|
- "$ref": "../../event-schemas/schema/core-event-schema/room_event.yaml"
|
||
9 years ago
|
400:
|
||
|
description: "Bad pagination ``from`` parameter."
|
||
9 years ago
|
# No tags to exclude this from the swagger UI - use the normal version instead.
|