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.
209 lines
6.9 KiB
YAML
209 lines
6.9 KiB
YAML
6 years ago
|
# Copyright 2018 New Vector 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.
|
||
|
swagger: '2.0'
|
||
|
info:
|
||
|
title: "Matrix Client-Server Third Party Lookup API"
|
||
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
|
- http
|
||
|
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||
|
consumes:
|
||
|
- application/json
|
||
|
produces:
|
||
|
- application/json
|
||
6 years ago
|
securityDefinitions:
|
||
|
$ref: definitions/security.yaml
|
||
6 years ago
|
paths:
|
||
|
"/thirdparty/protocols":
|
||
|
get:
|
||
|
summary: Retrieve metadata about all protocols that a homeserver supports.
|
||
|
description: |-
|
||
|
Fetches the overall metadata about protocols supported by the
|
||
|
homeserver. Includes both the available protocols and all fields
|
||
|
required for queries against each protocol.
|
||
6 years ago
|
operationId: getProtocols
|
||
6 years ago
|
security:
|
||
|
- accessToken: []
|
||
6 years ago
|
responses:
|
||
|
200:
|
||
|
description: The protocols supported by the homeserver.
|
||
|
schema:
|
||
6 years ago
|
$ref: ../application-service/definitions/protocol_metadata.yaml
|
||
6 years ago
|
"/thirdparty/protocol/{protocol}":
|
||
|
get:
|
||
|
summary: Retrieve metadata about a specific protocol that the homeserver supports.
|
||
|
description: |-
|
||
|
Fetches the metadata from the homeserver about a particular third party protocol.
|
||
6 years ago
|
operationId: getProtocolMetadata
|
||
6 years ago
|
security:
|
||
|
- accessToken: []
|
||
6 years ago
|
parameters:
|
||
|
- in: path
|
||
|
name: protocol
|
||
|
type: string
|
||
|
description: |-
|
||
|
The name of the protocol.
|
||
|
required: true
|
||
|
x-example: "irc"
|
||
|
responses:
|
||
|
200:
|
||
|
description: The protocol was found and metadata returned.
|
||
|
schema:
|
||
6 years ago
|
$ref: ../application-service/definitions/protocol.yaml
|
||
6 years ago
|
404:
|
||
6 years ago
|
description: The protocol is unknown.
|
||
6 years ago
|
examples:
|
||
|
application/json: {
|
||
|
"errcode": "M_NOT_FOUND"
|
||
|
}
|
||
|
schema:
|
||
6 years ago
|
$ref: definitions/errors/error.yaml
|
||
6 years ago
|
"/thirdparty/location/{protocol}":
|
||
|
get:
|
||
6 years ago
|
summary: Retrieve Matrix-side portals rooms leading to a third party location.
|
||
6 years ago
|
description: |-
|
||
|
Requesting this endpoint with a valid protocol name results in a list
|
||
|
of successful mapping results in a JSON array. Each result contains
|
||
|
objects to represent the Matrix room or rooms that represent a portal
|
||
|
to this third party network. Each has the Matrix room alias string,
|
||
|
an identifier for the particular third party network protocol, and an
|
||
|
object containing the network-specific fields that comprise this
|
||
|
identifier. It should attempt to canonicalise the identifier as much
|
||
|
as reasonably possible given the network type.
|
||
|
operationId: queryLocationByProtocol
|
||
6 years ago
|
security:
|
||
|
- accessToken: []
|
||
6 years ago
|
parameters:
|
||
|
- in: path
|
||
|
name: protocol
|
||
|
type: string
|
||
|
description: The protocol used to communicate to the third party network.
|
||
|
required: true
|
||
6 years ago
|
x-example: irc
|
||
6 years ago
|
- in: query
|
||
6 years ago
|
name: searchFields
|
||
6 years ago
|
type: string
|
||
|
description: |-
|
||
|
One or more custom fields to help identify the third party
|
||
|
location.
|
||
|
responses:
|
||
|
200:
|
||
|
description: At least one portal room was found.
|
||
|
schema:
|
||
6 years ago
|
$ref: ../application-service/definitions/location_batch.yaml
|
||
6 years ago
|
404:
|
||
6 years ago
|
description: No portal rooms were found.
|
||
6 years ago
|
examples:
|
||
|
application/json: {
|
||
|
"errcode": "M_NOT_FOUND"
|
||
|
}
|
||
|
schema:
|
||
6 years ago
|
$ref: definitions/errors/error.yaml
|
||
6 years ago
|
"/thirdparty/user/{protocol}":
|
||
|
get:
|
||
6 years ago
|
summary: Retrieve the Matrix User ID of a corresponding third party user.
|
||
6 years ago
|
description: |-
|
||
6 years ago
|
Retrieve a Matrix User ID linked to a user on the third party service, given
|
||
6 years ago
|
a set of user parameters.
|
||
|
operationId: queryUserByProtocol
|
||
6 years ago
|
security:
|
||
|
- accessToken: []
|
||
6 years ago
|
parameters:
|
||
|
- in: path
|
||
|
name: protocol
|
||
|
type: string
|
||
|
description: |-
|
||
|
The name of the protocol.
|
||
|
required: true
|
||
|
x-example: irc
|
||
|
- in: query
|
||
6 years ago
|
name: fields...
|
||
6 years ago
|
type: string
|
||
6 years ago
|
description: |-
|
||
|
One or more custom fields that are passed to the AS to help identify the user.
|
||
|
responses:
|
||
|
200:
|
||
6 years ago
|
description: The Matrix User IDs found with the given parameters.
|
||
6 years ago
|
schema:
|
||
6 years ago
|
$ref: ../application-service/definitions/user_batch.yaml
|
||
6 years ago
|
404:
|
||
6 years ago
|
description: The Matrix User ID was not found
|
||
6 years ago
|
examples:
|
||
|
application/json: {
|
||
|
"errcode": "M_NOT_FOUND"
|
||
|
}
|
||
|
schema:
|
||
6 years ago
|
$ref: definitions/errors/error.yaml
|
||
6 years ago
|
"/thirdparty/location":
|
||
|
get:
|
||
|
summary: Reverse-lookup third party locations given a Matrix room alias.
|
||
|
description: |-
|
||
6 years ago
|
Retrieve an array of third party network locations from a Matrix room
|
||
6 years ago
|
alias.
|
||
|
operationId: queryLocationByAlias
|
||
6 years ago
|
security:
|
||
|
- accessToken: []
|
||
6 years ago
|
parameters:
|
||
6 years ago
|
- in: query
|
||
6 years ago
|
name: alias
|
||
|
type: string
|
||
|
description: The Matrix room alias to look up.
|
||
|
required: true
|
||
6 years ago
|
x-example: "#matrix:matrix.org"
|
||
6 years ago
|
responses:
|
||
|
200:
|
||
|
description: |-
|
||
6 years ago
|
All found third party locations.
|
||
6 years ago
|
schema:
|
||
6 years ago
|
$ref: ../application-service/definitions/location_batch.yaml
|
||
6 years ago
|
404:
|
||
|
description: The Matrix room alias was not found
|
||
|
examples:
|
||
|
application/json: {
|
||
|
"errcode": "M_NOT_FOUND"
|
||
|
}
|
||
|
schema:
|
||
6 years ago
|
$ref: definitions/errors/error.yaml
|
||
6 years ago
|
"/thirdparty/user":
|
||
|
get:
|
||
6 years ago
|
summary: Reverse-lookup third party users given a Matrix User ID.
|
||
6 years ago
|
description: |-
|
||
6 years ago
|
Retrieve an array of third party users from a Matrix User ID.
|
||
6 years ago
|
operationId: queryUserByID
|
||
6 years ago
|
security:
|
||
|
- accessToken: []
|
||
6 years ago
|
parameters:
|
||
6 years ago
|
- in: query
|
||
6 years ago
|
name: userid
|
||
|
type: string
|
||
6 years ago
|
description: The Matrix User ID to look up.
|
||
|
required: true
|
||
6 years ago
|
x-example: "@bob:matrix.org"
|
||
6 years ago
|
responses:
|
||
|
200:
|
||
|
description: |-
|
||
|
An array of third party users.
|
||
|
schema:
|
||
6 years ago
|
$ref: ../application-service/definitions/user_batch.yaml
|
||
6 years ago
|
404:
|
||
6 years ago
|
description: The Matrix User ID was not found
|
||
6 years ago
|
examples:
|
||
|
application/json: {
|
||
|
"errcode": "M_NOT_FOUND"
|
||
|
}
|
||
|
schema:
|
||
6 years ago
|
$ref: definitions/errors/error.yaml
|