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.
231 lines
6.8 KiB
YAML
231 lines
6.8 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.
|
||
|
|
||
|
swagger: '2.0'
|
||
|
info:
|
||
|
title: "Matrix Client-Server device management API"
|
||
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
|
- http
|
||
|
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||
|
consumes:
|
||
|
- application/json
|
||
|
produces:
|
||
|
- application/json
|
||
|
securityDefinitions:
|
||
|
$ref: definitions/security.yaml
|
||
|
paths:
|
||
|
"/devices":
|
||
|
get:
|
||
|
summary: List registered devices for the current user
|
||
|
description: |-
|
||
|
Gets information about all devices for the current user.
|
||
7 years ago
|
operationId: getDevices
|
||
8 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
responses:
|
||
|
200:
|
||
|
description: Device information
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
devices:
|
||
|
type: array
|
||
|
description: A list of all registered devices for this user.
|
||
|
items:
|
||
|
type: object
|
||
|
allOf:
|
||
|
- $ref: "definitions/client_device.yaml"
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
8 years ago
|
"devices": [
|
||
|
{
|
||
|
"device_id": "QBUAZIFURK",
|
||
|
"display_name": "android",
|
||
|
"last_seen_ip": "1.2.3.4",
|
||
|
"last_seen_ts": 1474491775024
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
tags:
|
||
|
- Device management
|
||
|
"/devices/{deviceId}":
|
||
|
get:
|
||
|
summary: Get a single device
|
||
|
description: |-
|
||
|
Gets information on a single device, by device id.
|
||
7 years ago
|
operationId: getDevice
|
||
8 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: deviceId
|
||
|
description: The device to retrieve.
|
||
|
required: true
|
||
|
x-example: "QBUAZIFURK"
|
||
|
responses:
|
||
|
200:
|
||
|
description: Device information
|
||
|
schema:
|
||
|
type: object
|
||
|
allOf:
|
||
5 years ago
|
- $ref: "definitions/client_device.yaml"
|
||
8 years ago
|
examples:
|
||
7 years ago
|
application/json: {
|
||
8 years ago
|
"device_id": "QBUAZIFURK",
|
||
|
"display_name": "android",
|
||
|
"last_seen_ip": "1.2.3.4",
|
||
|
"last_seen_ts": 1474491775024
|
||
|
}
|
||
|
404:
|
||
|
description: The current user has no device with the given ID.
|
||
|
tags:
|
||
|
- Device management
|
||
8 years ago
|
put:
|
||
|
summary: Update a device
|
||
|
description: |-
|
||
|
Updates the metadata on the given device.
|
||
7 years ago
|
operationId: updateDevice
|
||
8 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: deviceId
|
||
|
description: The device to update.
|
||
|
required: true
|
||
|
x-example: "QBUAZIFURK"
|
||
|
- in: body
|
||
8 years ago
|
name: body
|
||
8 years ago
|
required: true
|
||
8 years ago
|
description: New information for the device.
|
||
8 years ago
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
display_name:
|
||
|
type: string
|
||
|
description: |-
|
||
5 years ago
|
The new display name for this device. If not given, the
|
||
|
display name is unchanged.
|
||
|
example: { "display_name": "My other phone" }
|
||
8 years ago
|
responses:
|
||
|
200:
|
||
|
description: The device was successfully updated.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
}
|
||
8 years ago
|
schema:
|
||
|
type: object # empty json object
|
||
|
404:
|
||
|
description: The current user has no device with the given ID.
|
||
8 years ago
|
tags:
|
||
|
- Device management
|
||
8 years ago
|
delete:
|
||
|
summary: Delete a device
|
||
|
description: |-
|
||
|
This API endpoint uses the `User-Interactive Authentication API`_.
|
||
|
|
||
7 years ago
|
Deletes the given device, and invalidates any access token associated with it.
|
||
7 years ago
|
operationId: deleteDevice
|
||
8 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: deviceId
|
||
8 years ago
|
description: The device to delete.
|
||
8 years ago
|
required: true
|
||
|
x-example: "QBUAZIFURK"
|
||
|
- in: body
|
||
|
name: body
|
||
5 years ago
|
required: true
|
||
8 years ago
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
auth:
|
||
|
description: |-
|
||
5 years ago
|
Additional authentication information for the
|
||
|
user-interactive authentication API.
|
||
|
allOf:
|
||
|
- "$ref": "definitions/auth_data.yaml"
|
||
8 years ago
|
responses:
|
||
|
200:
|
||
|
description: |-
|
||
|
The device was successfully removed, or had been removed
|
||
|
previously.
|
||
|
schema:
|
||
|
type: object
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
}
|
||
8 years ago
|
401:
|
||
|
description: |-
|
||
|
The homeserver requires additional authentication information.
|
||
|
schema:
|
||
|
"$ref": "definitions/auth_response.yaml"
|
||
|
tags:
|
||
|
- Device management
|
||
7 years ago
|
"/delete_devices":
|
||
|
post:
|
||
|
summary: Bulk deletion of devices
|
||
|
description: |-
|
||
|
This API endpoint uses the `User-Interactive Authentication API`_.
|
||
|
|
||
|
Deletes the given devices, and invalidates any access token associated with them.
|
||
|
operationId: deleteDevices
|
||
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: body
|
||
|
name: body
|
||
5 years ago
|
required: true
|
||
7 years ago
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
devices:
|
||
|
type: array
|
||
|
description: The list of device IDs to delete.
|
||
|
items:
|
||
|
type: string
|
||
|
description: A list of device IDs.
|
||
|
example: ["QBUAZIFURK", "AUIECTSRND"]
|
||
|
auth:
|
||
5 years ago
|
allOf:
|
||
|
- "$ref": "definitions/auth_data.yaml"
|
||
7 years ago
|
description: |-
|
||
|
Additional authentication information for the
|
||
|
user-interactive authentication API.
|
||
|
required:
|
||
|
- devices
|
||
|
responses:
|
||
|
200:
|
||
|
description: |-
|
||
|
The devices were successfully removed, or had been removed
|
||
|
previously.
|
||
|
schema:
|
||
|
type: object
|
||
|
examples:
|
||
|
application/json: {
|
||
|
}
|
||
|
401:
|
||
|
description: |-
|
||
|
The homeserver requires additional authentication information.
|
||
|
schema:
|
||
|
"$ref": "definitions/auth_response.yaml"
|
||
|
tags:
|
||
|
- Device management
|