Merge pull request #1152 from turt2live/travis/clarify-whoami
Improve documentation around /account/whoami
This commit is contained in:
commit
2644e5657d
2 changed files with 36 additions and 3 deletions
|
@ -29,7 +29,14 @@ paths:
|
||||||
get:
|
get:
|
||||||
summary: Gets information about the owner of an access token.
|
summary: Gets information about the owner of an access token.
|
||||||
description: |-
|
description: |-
|
||||||
Gets information about the owner of a given access token.
|
Gets information about the owner of a given access token.
|
||||||
|
|
||||||
|
Note that, as with the rest of the Client-Server API,
|
||||||
|
Application Services may masquerade as users within their
|
||||||
|
namespace by giving a ``user_id`` query parameter. In this
|
||||||
|
situation, the server should verify that the given ``user_id``
|
||||||
|
is registered by the appservice, and return it in the response
|
||||||
|
body.
|
||||||
operationId: getTokenOwner
|
operationId: getTokenOwner
|
||||||
security:
|
security:
|
||||||
- accessToken: []
|
- accessToken: []
|
||||||
|
@ -40,8 +47,8 @@ paths:
|
||||||
The token belongs to a known user.
|
The token belongs to a known user.
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"user_id": "@joe:example.org"
|
"user_id": "@joe:example.org"
|
||||||
}
|
}
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
required: ["user_id"]
|
required: ["user_id"]
|
||||||
|
@ -49,5 +56,29 @@ paths:
|
||||||
user_id:
|
user_id:
|
||||||
type: string
|
type: string
|
||||||
description: The user id that owns the access token.
|
description: The user id that owns the access token.
|
||||||
|
401:
|
||||||
|
description:
|
||||||
|
The token is not recognised
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_UNKNOWN_TOKEN",
|
||||||
|
"error": "Unrecognised access token."
|
||||||
|
}
|
||||||
|
schema:
|
||||||
|
"$ref": "definitions/error.yaml"
|
||||||
|
403:
|
||||||
|
description:
|
||||||
|
The appservice cannot masquerade as the user or has not registered them.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "Application service has not registered this user."
|
||||||
|
}
|
||||||
|
schema:
|
||||||
|
"$ref": "definitions/error.yaml"
|
||||||
|
429:
|
||||||
|
description: This request was rate-limited.
|
||||||
|
schema:
|
||||||
|
"$ref": "definitions/error.yaml"
|
||||||
tags:
|
tags:
|
||||||
- User data
|
- User data
|
||||||
|
|
|
@ -23,6 +23,8 @@ Unreleased changes
|
||||||
(`#1137 <https://github.com/matrix-org/matrix-doc/pull/1137>`_).
|
(`#1137 <https://github.com/matrix-org/matrix-doc/pull/1137>`_).
|
||||||
- Clarify that ``m.tag`` ordering is done with numbers, not strings
|
- Clarify that ``m.tag`` ordering is done with numbers, not strings
|
||||||
(`#1139 <https://github.com/matrix-org/matrix-doc/pull/1139>`_).
|
(`#1139 <https://github.com/matrix-org/matrix-doc/pull/1139>`_).
|
||||||
|
- Clarify that ``/account/whoami`` should consider application services
|
||||||
|
(`#1152 <https://github.com/matrix-org/matrix-doc/pull/1152>`_).
|
||||||
|
|
||||||
- Changes to the API which will be backwards-compatible for clients:
|
- Changes to the API which will be backwards-compatible for clients:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue