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.
192 lines
7.0 KiB
YAML
192 lines
7.0 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:
|
||
9 years ago
|
title: "Matrix Client-Server Room Inviting 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:
|
||
9 years ago
|
$ref: definitions/security.yaml
|
||
9 years ago
|
paths:
|
||
|
"/rooms/{roomId}/join":
|
||
|
post:
|
||
|
summary: Start the requesting user participating in a particular room.
|
||
|
description: |-
|
||
5 years ago
|
*Note that this API requires a room ID, not alias.*
|
||
|
``/join/{roomIdOrAlias}`` *exists if you have a room alias.*
|
||
9 years ago
|
|
||
9 years ago
|
This API starts a user participating in a particular room, if that user
|
||
|
is allowed to participate in that room. After this call, the client is
|
||
|
allowed to see all current state events in the room, and all subsequent
|
||
|
events associated with the room until the user leaves the room.
|
||
|
|
||
|
After a user has joined a room, the room will appear as an entry in the
|
||
9 years ago
|
response of the |/initialSync|_ and |/sync|_ APIs.
|
||
7 years ago
|
operationId: joinRoomById
|
||
9 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: roomId
|
||
9 years ago
|
description: The room identifier (not alias) to join.
|
||
|
required: true
|
||
|
x-example: "!d41d8cd:matrix.org"
|
||
9 years ago
|
- in: body
|
||
4 years ago
|
name: body
|
||
5 years ago
|
required: true
|
||
9 years ago
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
third_party_signed:
|
||
5 years ago
|
allOf:
|
||
|
- $ref: "definitions/third_party_signed.yaml"
|
||
|
description: |-
|
||
|
If supplied, the homeserver must verify that it matches a pending
|
||
|
``m.room.third_party_invite`` event in the room, and perform
|
||
|
key validity checking if required by the event.
|
||
4 years ago
|
reason:
|
||
|
type: string
|
||
|
description: |-
|
||
|
Optional reason to be included as the ``reason`` on the subsequent
|
||
|
membership event.
|
||
|
example: "Looking for support"
|
||
9 years ago
|
responses:
|
||
|
200:
|
||
|
description: |-
|
||
|
The room has been joined.
|
||
|
|
||
|
The joined room ID must be returned in the ``room_id`` field.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
"room_id": "!d41d8cd:matrix.org"}
|
||
9 years ago
|
schema:
|
||
|
type: object
|
||
7 years ago
|
properties:
|
||
|
room_id:
|
||
|
type: string
|
||
6 years ago
|
description: The joined room ID.
|
||
7 years ago
|
required: ["room_id"]
|
||
9 years ago
|
403:
|
||
|
description: |-
|
||
5 years ago
|
You do not have permission to join the room. A meaningful ``errcode``
|
||
|
and description error text will be returned. Example reasons for rejection are:
|
||
9 years ago
|
|
||
|
- The room is invite-only and the user was not invited.
|
||
|
- The user has been banned from the room.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
"errcode": "M_FORBIDDEN", "error": "You are not invited to this room."}
|
||
6 years ago
|
schema:
|
||
|
"$ref": "definitions/errors/error.yaml"
|
||
9 years ago
|
429:
|
||
|
description: This request was rate-limited.
|
||
|
schema:
|
||
6 years ago
|
"$ref": "definitions/errors/rate_limited.yaml"
|
||
9 years ago
|
tags:
|
||
|
- Room membership
|
||
|
"/join/{roomIdOrAlias}":
|
||
|
post:
|
||
|
summary: Start the requesting user participating in a particular room.
|
||
|
description: |-
|
||
|
*Note that this API takes either a room ID or alias, unlike* ``/room/{roomId}/join``.
|
||
|
|
||
|
This API starts a user participating in a particular room, if that user
|
||
|
is allowed to participate in that room. After this call, the client is
|
||
|
allowed to see all current state events in the room, and all subsequent
|
||
|
events associated with the room until the user leaves the room.
|
||
|
|
||
|
After a user has joined a room, the room will appear as an entry in the
|
||
|
response of the |/initialSync|_ and |/sync|_ APIs.
|
||
7 years ago
|
operationId: joinRoom
|
||
9 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: roomIdOrAlias
|
||
|
description: The room identifier or alias to join.
|
||
9 years ago
|
required: true
|
||
|
x-example: "#monkeys:matrix.org"
|
||
6 years ago
|
- in: query
|
||
|
type: array
|
||
|
items:
|
||
|
type: string
|
||
|
name: server_name
|
||
|
description: |-
|
||
|
The servers to attempt to join the room through. One of the servers
|
||
|
must be participating in the room.
|
||
|
x-example: ["matrix.org", "elsewhere.ca"]
|
||
9 years ago
|
- in: body
|
||
4 years ago
|
name: body
|
||
5 years ago
|
required: true
|
||
9 years ago
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
third_party_signed:
|
||
5 years ago
|
allOf:
|
||
|
- $ref: "definitions/third_party_signed.yaml"
|
||
|
description: |-
|
||
|
If a ``third_party_signed`` was supplied, the homeserver must verify
|
||
|
that it matches a pending ``m.room.third_party_invite`` event in the
|
||
|
room, and perform key validity checking if required by the event.
|
||
4 years ago
|
reason:
|
||
|
type: string
|
||
|
description: |-
|
||
|
Optional reason to be included as the ``reason`` on the subsequent
|
||
|
membership event.
|
||
|
example: "Looking for support"
|
||
9 years ago
|
responses:
|
||
|
200:
|
||
|
description: |-
|
||
|
The room has been joined.
|
||
|
|
||
|
The joined room ID must be returned in the ``room_id`` field.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
"room_id": "!d41d8cd:matrix.org"}
|
||
9 years ago
|
schema:
|
||
|
type: object
|
||
7 years ago
|
properties:
|
||
|
room_id:
|
||
|
type: string
|
||
6 years ago
|
description: The joined room ID.
|
||
7 years ago
|
required: ["room_id"]
|
||
9 years ago
|
403:
|
||
|
description: |-
|
||
5 years ago
|
You do not have permission to join the room. A meaningful ``errcode``
|
||
|
and description error text will be returned. Example reasons for rejection are:
|
||
9 years ago
|
|
||
|
- The room is invite-only and the user was not invited.
|
||
|
- The user has been banned from the room.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
"errcode": "M_FORBIDDEN", "error": "You are not invited to this room."}
|
||
6 years ago
|
schema:
|
||
|
"$ref": "definitions/errors/error.yaml"
|
||
9 years ago
|
429:
|
||
|
description: This request was rate-limited.
|
||
|
schema:
|
||
6 years ago
|
"$ref": "definitions/errors/rate_limited.yaml"
|
||
9 years ago
|
tags:
|
||
|
- Room membership
|