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.
140 lines
4.3 KiB
YAML
140 lines
4.3 KiB
YAML
9 years ago
|
swagger: '2.0'
|
||
|
info:
|
||
|
title: "Matrix Client-Server v2 filter API"
|
||
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
9 years ago
|
basePath: /_matrix/client/v2_alpha
|
||
9 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:
|
||
9 years ago
|
"/user/{userId}/filter":
|
||
|
post:
|
||
|
summary: Upload a new filter.
|
||
9 years ago
|
description: |-
|
||
|
Uploads a new filter definition to the homeserver.
|
||
|
Returns a filter ID that may be used in /sync requests to
|
||
|
retrict which events are returned to the client.
|
||
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: userId
|
||
|
required: true
|
||
|
description:
|
||
|
The id of the user uploading the filter. The access token must be
|
||
|
authorized to make requests for this user id.
|
||
|
x-example: "@alice:example.com"
|
||
|
- in: body
|
||
|
name: filter
|
||
|
required: true
|
||
|
description: The filter to upload.
|
||
|
schema:
|
||
|
type: object
|
||
|
allOf:
|
||
9 years ago
|
- $ref: "definitions/sync_filter.json"
|
||
9 years ago
|
example: |-
|
||
|
{
|
||
|
"room": {
|
||
|
"state": {
|
||
|
"types": ["m.room.*"],
|
||
|
"not_rooms": ["!726s6s6q:example.com"]
|
||
9 years ago
|
},
|
||
9 years ago
|
"timeline": {
|
||
9 years ago
|
"limit": 10,
|
||
9 years ago
|
"types": ["m.room.message"],
|
||
|
"not_rooms": ["!726s6s6q:example.com"],
|
||
|
"not_senders": ["@spam:example.com"]
|
||
9 years ago
|
},
|
||
9 years ago
|
"ephemeral": {
|
||
9 years ago
|
"types": ["m.receipt", "m.typing"],
|
||
|
"not_rooms": ["!726s6s6q:example.com"],
|
||
|
"not_senders": ["@spam:example.com"]
|
||
|
}
|
||
|
},
|
||
9 years ago
|
"presence": {
|
||
|
"types": ["m.presence"],
|
||
|
"not_senders": ["@alice:example.com"]
|
||
9 years ago
|
},
|
||
|
"event_format": "client",
|
||
|
"event_fields": ["type", "content", "sender"]
|
||
|
}
|
||
9 years ago
|
responses:
|
||
|
200:
|
||
|
description: The filter was created.
|
||
|
examples:
|
||
|
application/json: |-
|
||
|
{
|
||
|
"filter_id": "66696p746572"
|
||
|
}
|
||
|
schema:
|
||
|
type: object
|
||
|
properties:
|
||
|
filter_id:
|
||
|
type: string
|
||
9 years ago
|
description: |-
|
||
9 years ago
|
The ID of the filter that was created.
|
||
9 years ago
|
"/user/{userId}/filter/{filterId}":
|
||
|
get:
|
||
|
summary: Download a filter
|
||
|
parameters:
|
||
|
- in: path
|
||
|
name: userId
|
||
|
type: string
|
||
|
description: |-
|
||
|
The user ID to download a filter for.
|
||
|
x-example: "@alice:example.com"
|
||
9 years ago
|
required: true
|
||
9 years ago
|
- in: path
|
||
|
name: filterId
|
||
9 years ago
|
type: string
|
||
9 years ago
|
description: |-
|
||
|
The filter ID to download.
|
||
|
x-example: "66696p746572"
|
||
9 years ago
|
required: true
|
||
9 years ago
|
responses:
|
||
|
200:
|
||
9 years ago
|
description: |-
|
||
|
"The filter defintion"
|
||
9 years ago
|
examples:
|
||
|
application/json: |-
|
||
|
{
|
||
|
"room": {
|
||
|
"state": {
|
||
|
"types": ["m.room.*"],
|
||
|
"not_rooms": ["!726s6s6q:example.com"]
|
||
|
},
|
||
9 years ago
|
"timeline": {
|
||
9 years ago
|
"limit": 10,
|
||
9 years ago
|
"types": ["m.room.message"],
|
||
|
"not_rooms": ["!726s6s6q:example.com"],
|
||
|
"not_senders": ["@spam:example.com"]
|
||
|
},
|
||
9 years ago
|
"ephemeral": {
|
||
9 years ago
|
"types": ["m.receipt", "m.typing"],
|
||
|
"not_rooms": ["!726s6s6q:example.com"],
|
||
|
"not_senders": ["@spam:example.com"]
|
||
|
}
|
||
|
},
|
||
9 years ago
|
"presence": {
|
||
|
"types": ["m.presence"],
|
||
|
"not_senders": ["@alice:example.com"]
|
||
9 years ago
|
},
|
||
|
"event_format": "client",
|
||
|
"event_fields": ["type", "content", "sender"]
|
||
|
}
|
||
|
schema:
|
||
|
type: object
|
||
|
allOf:
|
||
|
- $ref: "definitions/sync_filter.json"
|