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.
92 lines
2.8 KiB
YAML
92 lines
2.8 KiB
YAML
8 years ago
|
# Copyright 2016 OpenMarket Ltd
|
||
|
#
|
||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
# you may not use this file except in compliance with the License.
|
||
|
# You may obtain a copy of the License at
|
||
|
#
|
||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||
|
#
|
||
|
# Unless required by applicable law or agreed to in writing, software
|
||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
# See the License for the specific language governing permissions and
|
||
|
# limitations under the License.
|
||
|
|
||
|
swagger: '2.0'
|
||
|
info:
|
||
|
title: "Matrix Client-Server Send-to-device API"
|
||
|
version: "1.0.0"
|
||
|
host: localhost:8008
|
||
|
schemes:
|
||
|
- https
|
||
|
- http
|
||
|
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION%
|
||
|
consumes:
|
||
|
- application/json
|
||
|
produces:
|
||
|
- application/json
|
||
|
securityDefinitions:
|
||
|
$ref: definitions/security.yaml
|
||
|
paths:
|
||
|
"/sendToDevice/{eventType}/{txnId}":
|
||
|
put:
|
||
8 years ago
|
summary: Send an event to a given set of devices.
|
||
8 years ago
|
description: |-
|
||
8 years ago
|
This endpoint is used to send send-to-device events to a set of
|
||
8 years ago
|
client devices.
|
||
7 years ago
|
operationId: sendToDevice
|
||
8 years ago
|
security:
|
||
|
- accessToken: []
|
||
|
parameters:
|
||
|
- in: path
|
||
|
type: string
|
||
|
name: eventType
|
||
|
description: The type of event to send.
|
||
|
required: true
|
||
|
x-example: "m.new_device"
|
||
|
- in: path
|
||
|
name: txnId
|
||
|
type: string
|
||
|
description: |-
|
||
|
The transaction ID for this event. Clients should generate an
|
||
|
ID unique across requests with the same access token; it will be
|
||
|
used by the server to ensure idempotency of requests.
|
||
|
required: true
|
||
|
x-example: "35"
|
||
|
- in: body
|
||
|
name: body
|
||
|
required: true
|
||
|
schema:
|
||
|
type: object
|
||
|
title: body
|
||
|
properties:
|
||
|
messages:
|
||
|
type: object
|
||
|
description: |-
|
||
|
The messages to send. A map from user ID, to a map from
|
||
|
device ID to message body. The device ID may also be `*`,
|
||
|
meaning all known devices for the user.
|
||
|
additionalProperties:
|
||
|
type: object
|
||
|
additionalProperties:
|
||
|
type: object
|
||
|
title: EventContent
|
||
|
description: Message content
|
||
|
example: {
|
||
|
"@alice:example.com": {
|
||
8 years ago
|
"TLLBEANAAG": {
|
||
8 years ago
|
"example_content_key": "value"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
4 years ago
|
required: ["messages"]
|
||
8 years ago
|
responses:
|
||
|
200:
|
||
|
description:
|
||
|
The message was successfully sent.
|
||
|
examples:
|
||
7 years ago
|
application/json: {
|
||
|
}
|
||
8 years ago
|
tags:
|
||
8 years ago
|
- Send-to-Device messaging
|