Merge remote-tracking branch 'remotes/origin/master'

This commit is contained in:
Kitsune Ral 2017-11-15 07:32:44 +09:00
commit b53083732b
12 changed files with 295 additions and 28 deletions

View file

@ -18,16 +18,24 @@ info:
host: localhost:8008
schemes:
- https
- http
basePath: /_matrix/media/%CLIENT_MAJOR_VERSION%
consumes:
- application/json
- "*/*"
produces:
- application/json
- "*/*"
securityDefinitions:
$ref: definitions/security.yaml
paths:
"/upload":
post:
summary: Upload some content to the content repository.
operationId: uploadContent
produces: ["application/json"]
security:
- accessToken: []
parameters:
- in: header
name: Content-Type
@ -61,6 +69,10 @@ paths:
application/json: {
"content_uri": "mxc://example.com/AQwafuaFswefuhsfAFAgsw"
}
429:
description: This request was rate-limited.
schema:
"$ref": "definitions/error.yaml"
tags:
- Media
"/download/{serverName}/{mediaId}":
@ -95,6 +107,10 @@ paths:
type: "string"
schema:
type: file
429:
description: This request was rate-limited.
schema:
"$ref": "definitions/error.yaml"
tags:
- Media
"/download/{serverName}/{mediaId}/{fileName}":
@ -136,6 +152,10 @@ paths:
type: "string"
schema:
type: file
429:
description: This request was rate-limited.
schema:
"$ref": "definitions/error.yaml"
tags:
- Media
"/thumbnail/{serverName}/{mediaId}":
@ -188,5 +208,63 @@ paths:
enum: ["image/jpeg", "image/png"]
schema:
type: file
429:
description: This request was rate-limited.
schema:
"$ref": "definitions/error.yaml"
tags:
- Media
"/preview_url":
get:
summary: "Get information about a URL for a client"
produces: ["application/json"]
security:
- accessToken: []
parameters:
- in: query
type: string
x-example: "https://matrix.org"
name: url
description: "The URL to get a preview of"
required: true
- in: query
type: number
x-example: 1510610716656
name: ts
description: |-
The preferred point in time to return a preview for. The server may
return a newer version if it does not have the requested version
available.
responses:
200:
description: |-
The OpenGraph data for the URL, which may be empty. Some values are
replaced with matrix equivalents if they are provided in the response.
The differences from the OpenGraph protocol are described here.
schema:
type: object
properties:
"matrix:image:size":
type: number
description: |-
The byte-size of the image. Omitted if there is no image attached.
"og:image":
type: string
description: |-
An MXC URI to the image. Ommitted if there is no image.
examples:
application/json: {
"og:title": "Matrix Blog Post",
"og:description": "This is a really cool blog post from matrix.org",
"og:image": "mxc://example.com/ascERGshawAWawugaAcauga",
"og:image:type": "image/png",
"og:image:height": 48,
"og:image:width": 48,
"matrix:image:size": 102400
}
429:
description: This request was rate-limited.
schema:
"$ref": "definitions/error.yaml"
tags:
- Media

View file

@ -0,0 +1,52 @@
# Copyright 2017 Travis Ralston
#
# 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 Account Identification API"
version: "1.0.0"
host: localhost:8008
schemes:
- https
- http
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
produces:
- application/json
securityDefinitions:
$ref: definitions/security.yaml
paths:
"/account/whoami":
get:
summary: Gets information about the owner of an access token.
description: |-
Gets information about the owner of a given access token.
security:
- accessToken: []
parameters: []
responses:
200:
description:
The token belongs to a known user.
examples:
application/json: {
"user_id": "@joe:example.org"
}
schema:
type: object
required: ["user_id"]
properties:
user_id:
type: string
description: The user id that owns the access token.
tags:
- User data

View file

@ -1,4 +1,6 @@
# Copyright 2016 OpenMarket Ltd
# Copyright 2017 Kamax.io
# Copyright 2017 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.
@ -33,13 +35,13 @@ paths:
type: string
name: medium
required: true
description: The literal string "email".
description: The medium type of the 3pid. See the `3PID Types`_ Appendix.
x-example: "email"
- in: query
type: string
name: address
required: true
description: The email address being looked up.
description: The address of the 3pid being looked up. See the `3PID Types`_ Appendix.
x-example: "louise@bobs.burgers"
responses:
200:
@ -83,4 +85,57 @@ paths:
description: The unix timestamp at which the association was verified.
signatures:
type: object
description: The signatures of the verifying identity service which show that the association should be trusted, if you trust the verifying identity service.
description: The signatures of the verifying identity services which show that the association should be trusted, if you trust the verifying identity services.
"/bulk_lookup":
post:
summary: Lookup Matrix user IDs for a list of 3pids.
description: Lookup Matrix user IDs for a list of 3pids.
parameters:
- in: body
name: body
schema:
type: object
example: {
"threepids":
[
["email","user@example.org"],
["msisdn", "123456789"],
["email","user2@example.org"]
]
}
properties:
threepids:
type: array
items:
type: array
title: 3PID mappings
items:
type: string
title: 3PID medium or address
description: an array of arrays containing the `3PID Types`_ with the ``medium`` in first position and the ``address`` in second position.
required:
- "threepids"
responses:
200:
description: A list of known 3PID mappings for the supplied 3PIDs.
examples:
application/json: {
"threepids": [
["email","user@example.org", "@bla:example.org"],
["msisdn", "123456789", "@blah2:example.com"]
]
}
schema:
type: object
properties:
threepids:
type: array
items:
type: array
title: 3PID mappings
items:
type: string
title: 3PID medium or address or the Matrix ID
description: an array of array containing the `3PID Types`_ with the ``medium`` in first position, the ``address`` in second position and Matrix ID in third position.
required:
- "threepids"