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.
195 lines
6.1 KiB
YAML
195 lines
6.1 KiB
YAML
10 years ago
|
swagger: '2.0'
|
||
|
info:
|
||
|
title: "Matrix Client-Server v1 Profile API"
|
||
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
|
- http
|
||
10 years ago
|
basePath: /_matrix/client/api/v1
|
||
10 years ago
|
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:
|
||
10 years ago
|
"/profile/{userId}/displayname":
|
||
10 years ago
|
put:
|
||
|
summary: Set the user's display name.
|
||
10 years ago
|
description: |-
|
||
|
This API sets the given user's display name. You must have permission to
|
||
|
set this user's display name, e.g. you need to have their ``access_token``.
|
||
10 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: userId
|
||
|
description: The user whose display name to set.
|
||
|
required: true
|
||
10 years ago
|
x-example: "@alice:example.com"
|
||
10 years ago
|
- in: body
|
||
|
name: displayName
|
||
|
description: The display name info.
|
||
|
required: true
|
||
|
schema:
|
||
|
type: object
|
||
10 years ago
|
example: |-
|
||
|
{
|
||
|
"displayname": "Alice Margatroid"
|
||
|
}
|
||
10 years ago
|
properties:
|
||
|
displayname:
|
||
|
type: string
|
||
|
description: The new display name for this user.
|
||
|
responses:
|
||
|
200:
|
||
|
description: The display name was set.
|
||
10 years ago
|
examples:
|
||
|
application/json: |-
|
||
|
{}
|
||
10 years ago
|
schema:
|
||
|
type: object # empty json object
|
||
10 years ago
|
429:
|
||
|
description: This request was rate-limited.
|
||
|
schema:
|
||
|
"$ref": "definitions/error.yaml"
|
||
10 years ago
|
get:
|
||
|
summary: Get the user's display name.
|
||
10 years ago
|
description: |-
|
||
|
Get the user's display name. This API may be used to fetch the user's
|
||
|
own displayname or to query the name of other users; either locally or
|
||
|
on remote homeservers.
|
||
10 years ago
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: userId
|
||
|
description: The user whose display name to get.
|
||
|
required: true
|
||
10 years ago
|
x-example: "@alice:example.com"
|
||
10 years ago
|
responses:
|
||
|
200:
|
||
|
description: The display name for this user.
|
||
10 years ago
|
examples:
|
||
|
application/json: |-
|
||
|
{
|
||
|
"displayname": "Alice Margatroid"
|
||
|
}
|
||
10 years ago
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
displayname:
|
||
|
type: string
|
||
|
description: The user's display name if they have set one.
|
||
|
404:
|
||
|
description: There is no display name for this user or this user does not exist.
|
||
10 years ago
|
"/profile/{userId}/avatar_url":
|
||
10 years ago
|
put:
|
||
|
summary: Set the user's avatar URL.
|
||
10 years ago
|
description: |-
|
||
|
This API sets the given user's avatar URL. You must have permission to
|
||
|
set this user's avatar URL, e.g. you need to have their ``access_token``.
|
||
10 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: userId
|
||
|
description: The user whose avatar URL to set.
|
||
|
required: true
|
||
10 years ago
|
x-example: "@alice:example.com"
|
||
10 years ago
|
- in: body
|
||
|
name: avatar_url
|
||
|
description: The avatar url info.
|
||
|
required: true
|
||
|
schema:
|
||
|
type: object
|
||
10 years ago
|
example: |-
|
||
|
{
|
||
10 years ago
|
"avatar_url": "mxc://matrix.org/wefh34uihSDRGhw34"
|
||
10 years ago
|
}
|
||
10 years ago
|
properties:
|
||
|
avatar_url:
|
||
|
type: string
|
||
|
description: The new avatar URL for this user.
|
||
|
responses:
|
||
|
200:
|
||
|
description: The avatar URL was set.
|
||
10 years ago
|
examples:
|
||
|
application/json: |-
|
||
|
{}
|
||
10 years ago
|
schema:
|
||
|
type: object # empty json object
|
||
10 years ago
|
429:
|
||
|
description: This request was rate-limited.
|
||
|
schema:
|
||
|
"$ref": "definitions/error.yaml"
|
||
10 years ago
|
get:
|
||
|
summary: Get the user's avatar URL.
|
||
10 years ago
|
description: |-
|
||
|
Get the user's avatar URL. This API may be used to fetch the user's
|
||
|
own avatar URL or to query the URL of other users; either locally or
|
||
|
on remote homeservers.
|
||
10 years ago
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: userId
|
||
|
description: The user whose avatar URL to get.
|
||
|
required: true
|
||
10 years ago
|
x-example: "@alice:example.com"
|
||
10 years ago
|
responses:
|
||
|
200:
|
||
|
description: The avatar URL for this user.
|
||
10 years ago
|
examples:
|
||
|
application/json: |-
|
||
|
{
|
||
|
"avatar_url": "mxc://matrix.org/SDGdghriugerRg"
|
||
|
}
|
||
10 years ago
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
avatar_url:
|
||
|
type: string
|
||
|
description: The user's avatar URL if they have set one.
|
||
|
404:
|
||
10 years ago
|
description: There is no avatar URL for this user or this user does not exist.
|
||
|
"/profile/{userId}":
|
||
|
get:
|
||
|
summary: Get this user's profile information.
|
||
|
description: |-
|
||
|
Get the combined profile information for this user. This API may be used
|
||
|
to fetch the user's own profile information or other users; either
|
||
|
locally or on remote homeservers. This API may return keys which are not
|
||
|
limited to ``displayname`` or ``avatar_url``.
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: userId
|
||
|
description: The user whose avatar URL to get.
|
||
|
required: true
|
||
|
x-example: "@alice:example.com"
|
||
|
responses:
|
||
|
200:
|
||
|
description: The avatar URL for this user.
|
||
|
examples:
|
||
|
application/json: |-
|
||
|
{
|
||
|
"avatar_url": "mxc://matrix.org/SDGdghriugerRg",
|
||
|
"displayname": "Alice Margatroid"
|
||
|
}
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
avatar_url:
|
||
|
type: string
|
||
|
description: The user's avatar URL if they have set one.
|
||
|
displayname:
|
||
|
type: string
|
||
|
description: The user's display name if they have set one.
|
||
|
404:
|
||
|
description: There is no profile information for this user or this user does not exist.
|