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.
224 lines
7.5 KiB
YAML
224 lines
7.5 KiB
YAML
8 years ago
|
# 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.
|
||
9 years ago
|
swagger: '2.0'
|
||
|
info:
|
||
7 years ago
|
title: "Matrix Client-Server Room Directory 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
|
||
|
paths:
|
||
7 years ago
|
"/directory/list/room/{roomId}":
|
||
|
get:
|
||
|
summary: Gets the visibility of a room in the directory
|
||
|
description: |-
|
||
|
Gets the visibility of a given room on the server's public room directory.
|
||
|
operationId: getRoomVisibilityOnDirectory
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: roomId
|
||
|
description: The room ID.
|
||
|
required: true
|
||
|
x-example: "!curbf:matrix.org"
|
||
|
responses:
|
||
|
200:
|
||
|
description: The visibility of the room in the directory
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
visibility:
|
||
|
type: string
|
||
|
enum: ['private', 'public']
|
||
|
description: The visibility of the room in the directory.
|
||
|
examples:
|
||
|
application/json: {
|
||
7 years ago
|
"visibility": "public"
|
||
|
}
|
||
7 years ago
|
404:
|
||
7 years ago
|
description: The room is not known to the server
|
||
|
examples:
|
||
|
application/json: {
|
||
7 years ago
|
"errcode": "M_NOT_FOUND",
|
||
|
"error": "Room not found"
|
||
|
}
|
||
6 years ago
|
schema:
|
||
|
"$ref": "definitions/errors/error.yaml"
|
||
7 years ago
|
put:
|
||
|
summary: Sets the visibility of a room in the room directory
|
||
|
description: |-
|
||
|
Sets the visibility of a given room in the server's public room
|
||
|
directory.
|
||
7 years ago
|
|
||
|
Servers may choose to implement additional access control checks
|
||
|
here, for instance that room visibility can only be changed by
|
||
|
the room creator or a server administrator.
|
||
7 years ago
|
operationId: setRoomVisibilityOnDirectory
|
||
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: roomId
|
||
|
description: The room ID.
|
||
|
required: true
|
||
|
x-example: "!curbf:matrix.org"
|
||
|
- in: body
|
||
|
name: body
|
||
|
required: true
|
||
|
description: |-
|
||
|
The new visibility for the room on the room directory.
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
visibility:
|
||
|
type: string
|
||
|
enum: ["private", "public"]
|
||
|
description: |-
|
||
|
The new visibility setting for the room.
|
||
|
Defaults to 'public'.
|
||
|
example: {
|
||
7 years ago
|
"visibility": "public"
|
||
|
}
|
||
7 years ago
|
responses:
|
||
|
200:
|
||
|
description: The visibility was updated, or no change was needed.
|
||
|
examples:
|
||
7 years ago
|
application/json: {}
|
||
7 years ago
|
404:
|
||
7 years ago
|
description: The room is not known to the server
|
||
|
examples:
|
||
|
application/json: {
|
||
7 years ago
|
"errcode": "M_NOT_FOUND",
|
||
|
"error": "Room not found"
|
||
|
}
|
||
6 years ago
|
schema:
|
||
|
"$ref": "definitions/errors/error.yaml"
|
||
9 years ago
|
"/publicRooms":
|
||
|
get:
|
||
|
summary: Lists the public rooms on the server.
|
||
|
description: |-
|
||
|
Lists the public rooms on the server.
|
||
|
|
||
8 years ago
|
This API returns paginated responses. The rooms are ordered by the number
|
||
8 years ago
|
of joined members, with the largest rooms first.
|
||
7 years ago
|
operationId: getPublicRooms
|
||
8 years ago
|
parameters:
|
||
|
- in: query
|
||
|
name: limit
|
||
6 years ago
|
type: integer
|
||
8 years ago
|
description: |-
|
||
8 years ago
|
Limit the number of results returned.
|
||
8 years ago
|
- in: query
|
||
|
name: since
|
||
|
type: string
|
||
|
description: |-
|
||
|
A pagination token from a previous request, allowing clients to
|
||
8 years ago
|
get the next (or previous) batch of rooms.
|
||
8 years ago
|
The direction of pagination is specified solely by which token
|
||
|
is supplied, rather than via an explicit flag.
|
||
8 years ago
|
- in: query
|
||
|
name: server
|
||
|
type: string
|
||
|
description: |-
|
||
|
The server to fetch the public room lists from. Defaults to the
|
||
|
local server.
|
||
8 years ago
|
responses:
|
||
|
200:
|
||
|
description: A list of the rooms on the server.
|
||
|
schema:
|
||
6 years ago
|
$ref: "definitions/public_rooms_response.yaml"
|
||
8 years ago
|
tags:
|
||
|
- Room discovery
|
||
8 years ago
|
post:
|
||
|
summary: Lists the public rooms on the server with optional filter.
|
||
|
description: |-
|
||
8 years ago
|
Lists the public rooms on the server, with optional filter.
|
||
8 years ago
|
|
||
8 years ago
|
This API returns paginated responses. The rooms are ordered by the number
|
||
8 years ago
|
of joined members, with the largest rooms first.
|
||
7 years ago
|
operationId: queryPublicRooms
|
||
8 years ago
|
security:
|
||
|
- accessToken: []
|
||
8 years ago
|
parameters:
|
||
|
- in: query
|
||
|
name: server
|
||
|
type: string
|
||
|
description: |-
|
||
|
The server to fetch the public room lists from. Defaults to the
|
||
|
local server.
|
||
|
- in: body
|
||
|
name: body
|
||
|
required: true
|
||
|
description: |-
|
||
|
Options for which rooms to return.
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
limit:
|
||
6 years ago
|
type: integer
|
||
8 years ago
|
description: |-
|
||
8 years ago
|
Limit the number of results returned.
|
||
8 years ago
|
since:
|
||
|
type: string
|
||
|
description: |-
|
||
8 years ago
|
A pagination token from a previous request, allowing clients
|
||
|
to get the next (or previous) batch of rooms. The direction
|
||
|
of pagination is specified solely by which token is supplied,
|
||
|
rather than via an explicit flag.
|
||
8 years ago
|
filter:
|
||
|
type: object
|
||
8 years ago
|
title: "Filter"
|
||
8 years ago
|
description: |-
|
||
8 years ago
|
Filter to apply to the results.
|
||
8 years ago
|
properties:
|
||
|
generic_search_term:
|
||
|
type: string
|
||
|
description: |-
|
||
|
A string to search for in the room metadata, e.g. name,
|
||
8 years ago
|
topic, canonical alias etc. (Optional).
|
||
6 years ago
|
include_all_networks:
|
||
|
type: boolean
|
||
|
description: |-
|
||
|
Whether or not to include all known networks/protocols from
|
||
|
application services on the homeserver. Defaults to false.
|
||
|
example: false
|
||
|
third_party_instance_id:
|
||
|
type: string
|
||
|
description: |-
|
||
|
The specific third party network/protocol to request from the
|
||
|
homeserver. Can only be used if ``include_all_networks`` is false.
|
||
|
example: "irc"
|
||
7 years ago
|
example: {
|
||
6 years ago
|
"limit": 10,
|
||
|
"filter": {
|
||
|
"generic_search_term": "foo"
|
||
|
},
|
||
|
"include_all_networks": false,
|
||
|
"third_party_instance_id": "irc"
|
||
|
}
|
||
9 years ago
|
responses:
|
||
|
200:
|
||
|
description: A list of the rooms on the server.
|
||
|
schema:
|
||
6 years ago
|
$ref: "definitions/public_rooms_response.yaml"
|
||
9 years ago
|
tags:
|
||
|
- Room discovery
|