mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-26 13:04:10 +01:00
Error response examples, cribbed from Synapse
This commit is contained in:
parent
f721128371
commit
bd2ccfa91e
|
|
@ -74,15 +74,30 @@ paths:
|
||||||
400:
|
400:
|
||||||
description: |-
|
description: |-
|
||||||
The request body is not a JSON object.
|
The request body is not a JSON object.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_BAD_JSON",
|
||||||
|
"error": "Content must be a JSON object."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
403:
|
403:
|
||||||
description: |-
|
description: |-
|
||||||
The access token provided is not authorized to modify this user's account
|
The access token provided is not authorized to modify this user's account
|
||||||
data.
|
data.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "Cannot add account data for other users."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
405:
|
405:
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_BAD_JSON",
|
||||||
|
"error": "Cannot set m.fully_read through this API."
|
||||||
|
}
|
||||||
description: |-
|
description: |-
|
||||||
This `type` of account data is controlled by the server; it cannot be
|
This `type` of account data is controlled by the server; it cannot be
|
||||||
modified by clients.
|
modified by clients.
|
||||||
|
|
@ -127,11 +142,21 @@ paths:
|
||||||
description: |-
|
description: |-
|
||||||
The access token provided is not authorized to retrieve this user's account
|
The access token provided is not authorized to retrieve this user's account
|
||||||
data.
|
data.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "Cannot add account data for other users."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
404:
|
404:
|
||||||
description: |-
|
description: |-
|
||||||
No account data has been provided for this user with the given `type`.
|
No account data has been provided for this user with the given `type`.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_NOT_FOUND",
|
||||||
|
"error": "Room account data not found."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -190,18 +215,33 @@ paths:
|
||||||
400:
|
400:
|
||||||
description: |-
|
description: |-
|
||||||
The request body is not a JSON object.
|
The request body is not a JSON object.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_BAD_JSON",
|
||||||
|
"error": "Content must be a JSON object."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
403:
|
403:
|
||||||
description: |-
|
description: |-
|
||||||
The access token provided is not authorized to modify this user's account
|
The access token provided is not authorized to modify this user's account
|
||||||
data.
|
data.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "Cannot add account data for other users."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
405:
|
405:
|
||||||
description: |-
|
description: |-
|
||||||
This `type` of account data is controlled by the server; it cannot be
|
This `type` of account data is controlled by the server; it cannot be
|
||||||
modified by clients.
|
modified by clients.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_BAD_JSON",
|
||||||
|
"error": "Cannot set m.fully_read through this API."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -250,12 +290,22 @@ paths:
|
||||||
description: |-
|
description: |-
|
||||||
The access token provided is not authorized to retrieve this user's account
|
The access token provided is not authorized to retrieve this user's account
|
||||||
data.
|
data.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "Cannot add account data for other users."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
404:
|
404:
|
||||||
description: |-
|
description: |-
|
||||||
No account data has been provided for this user and this room with the
|
No account data has been provided for this user and this room with the
|
||||||
given `type`.
|
given `type`.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_NOT_FOUND",
|
||||||
|
"error": "Room account data not found."
|
||||||
|
}
|
||||||
schema:
|
schema:
|
||||||
$ref: "../client-server/definitions/errors/error.yaml"
|
$ref: "../client-server/definitions/errors/error.yaml"
|
||||||
tags:
|
tags:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue