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.
80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
9 years ago
|
swagger: '2.0'
|
||
|
info:
|
||
|
title: "Matrix Client-Server v1 Registration and Login API"
|
||
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
|
- http
|
||
|
basePath: /_matrix/client/api/v1
|
||
|
consumes:
|
||
|
- application/json
|
||
|
produces:
|
||
|
- application/json
|
||
|
securityDefinitions:
|
||
|
accessToken:
|
||
|
type: apiKey
|
||
|
description: The user_id or application service access_token
|
||
|
name: access_token
|
||
|
in: query
|
||
|
paths:
|
||
|
"/login":
|
||
|
post:
|
||
|
summary: Authenticates the user.
|
||
|
description: |-
|
||
|
Authenticates the user by password, and issues an access token they can
|
||
|
use to authorize themself in subsequent requests.
|
||
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: body
|
||
|
name: body
|
||
|
required: true
|
||
|
schema:
|
||
|
type: object
|
||
|
example: |-
|
||
|
{
|
||
|
"username": "cheeky_monkey",
|
||
|
"password": "ilovebananas"
|
||
|
}
|
||
|
properties:
|
||
|
username:
|
||
|
type: string
|
||
|
description: The fully qualified user ID or just local part of the user ID, to log in.
|
||
|
password:
|
||
|
type: string
|
||
|
description: The user's password.
|
||
|
required: ["username", "password"]
|
||
|
responses:
|
||
|
200:
|
||
|
description: The user has been authenticated.
|
||
|
examples:
|
||
|
application/json: |-
|
||
|
{
|
||
|
"user_id": "@cheeky_monkey:matrix.org",
|
||
|
"access_token": "abc123",
|
||
|
"home_server": "matrix.org"
|
||
|
}
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
user_id:
|
||
|
type: string
|
||
|
description: The fully-qualified Matrix ID that has been registered.
|
||
|
access_token:
|
||
|
type: string
|
||
|
description: An access token for the account. This access token can then be used to authorize other requests.
|
||
|
home_server:
|
||
|
type: string
|
||
|
description: The hostname of the Home Server on which the account has been registered.
|
||
|
403:
|
||
|
description: |-
|
||
|
The login attempt failed. For example, the password may have been incorrect.
|
||
|
examples:
|
||
|
application/json: |-
|
||
|
{"errcode": "M_FORBIDDEN"}
|
||
|
429:
|
||
|
description: This request was rate-limited.
|
||
|
schema:
|
||
|
"$ref": "definitions/error.yaml"
|