Merge pull request #1873 from matrix-org/travis/spec/get-account-data

Add routes for retrieving account data
pull/977/head
Travis Ralston 6 years ago committed by GitHub
commit 26810bccef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,8 +43,8 @@ paths:
name: userId name: userId
required: true required: true
description: |- description: |-
The id of the user to set account_data for. The access token must be The ID of the user to set account_data for. The access token must be
authorized to make requests for this user id. authorized to make requests for this user ID.
x-example: "@alice:example.com" x-example: "@alice:example.com"
- in: path - in: path
type: string type: string
@ -69,6 +69,41 @@ paths:
The account_data was successfully added. The account_data was successfully added.
tags: tags:
- User data - User data
get:
summary: Get some account_data for the user.
description: |-
Get some account_data for the client. This config is only visible to the user
that set the account_data.
operationId: getAccountData
security:
- accessToken: []
parameters:
- in: path
type: string
name: userId
required: true
description: |-
The ID of the user to get account_data for. The access token must be
authorized to make requests for this user ID.
x-example: "@alice:example.com"
- in: path
type: string
name: type
required: true
description: |-
The event type of the account_data to get. Custom types should be
namespaced to avoid clashes.
x-example: "org.example.custom.config"
responses:
200:
description:
The account data content for the given type.
schema:
type: object
example: {
"custom_account_data_key": "custom_config_value"}
tags:
- User data
"/user/{userId}/rooms/{roomId}/account_data/{type}": "/user/{userId}/rooms/{roomId}/account_data/{type}":
put: put:
summary: Set some account_data for the user. summary: Set some account_data for the user.
@ -85,15 +120,15 @@ paths:
name: userId name: userId
required: true required: true
description: |- description: |-
The id of the user to set account_data for. The access token must be The ID of the user to set account_data for. The access token must be
authorized to make requests for this user id. authorized to make requests for this user ID.
x-example: "@alice:example.com" x-example: "@alice:example.com"
- in: path - in: path
type: string type: string
name: roomId name: roomId
required: true required: true
description: |- description: |-
The id of the room to set account_data on. The ID of the room to set account_data on.
x-example: "!726s6s6q:example.com" x-example: "!726s6s6q:example.com"
- in: path - in: path
type: string type: string
@ -118,3 +153,45 @@ paths:
The account_data was successfully added. The account_data was successfully added.
tags: tags:
- User data - User data
get:
summary: Get some account_data for the user.
description: |-
Get some account_data for the client on a given room. This config is only
visible to the user that set the account_data.
operationId: getAccountDataPerRoom
security:
- accessToken: []
parameters:
- in: path
type: string
name: userId
required: true
description: |-
The ID of the user to set account_data for. The access token must be
authorized to make requests for this user ID.
x-example: "@alice:example.com"
- in: path
type: string
name: roomId
required: true
description: |-
The ID of the room to get account_data for.
x-example: "!726s6s6q:example.com"
- in: path
type: string
name: type
required: true
description: |-
The event type of the account_data to get. Custom types should be
namespaced to avoid clashes.
x-example: "org.example.custom.room.config"
responses:
200:
description:
The account data content for the given type.
schema:
type: object
example: {
"custom_account_data_key": "custom_config_value"}
tags:
- User data

@ -0,0 +1 @@
``GET /account_data`` routes.
Loading…
Cancel
Save