Files
matterbridge/docs/swagger/swagger.yaml
2018-11-29 04:32:58 +08:00

139 lines
3.4 KiB
YAML

basePath: /api
definitions:
config.Message:
properties:
account:
description: |
Unique account name of format "[protocol].[slug]"
example: slack.myteam
type: string
avatar:
description: |
URL to an avatar image
example: https://secure.gravatar.com/avatar/1234567890abcdef1234567890abcdef.jpg
type: string
channel:
description: |
Human-readable channel name
example: test-channel
type: string
event:
description: |
Can be blank.
type: string
extra:
description: |
Extra data that doesn't fit in other fields. Used for processing incoming messages.
type: object
gateway:
description: |
Name of the gateway
example: test-channel-gateway
type: string
id:
description: |
Unique ID of message on the gateway
example: slack 1541361213.030700
type: string
parent_id:
description: |
Unique ID of a parent message, if threaded
type: string
protocol:
description: |
Chat protocol of incoming message
example: slack
type: string
text:
description: |
Content of the message
example: Testing, testing, 1-2-3.
type: string
timestamp:
example: "1541361213.030700"
type: string
userid:
description: |
userid on the bridge
example: U4MCXJKNC
type: string
username:
description: |
Human-readable username
example: alice
type: string
type: object
info:
contact: {}
description: A read/write API for the Matterbridge chat bridge.
license:
name: Apache 2.0
url: https://github.com/42wim/matterbridge/blob/master/LICENSE
title: Matterbridge API
paths:
/health:
get:
responses:
"200":
description: OK
schema:
type: string
summary: Checks if the server is alive.
/message:
post:
consumes:
- application/json
description: 'Required fields: text, gateway. Optional fields: username, avatar.'
parameters:
- description: Message object to create
in: body
name: message
required: true
schema:
$ref: '#/definitions/config.Message'
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/config.Message'
type: object
security:
- ApiKeyAuth: []
summary: Create/Update a message
/messages:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/config.Message'
type: array
security:
- ApiKeyAuth: []
summary: List new messages
/stream:
get:
produces:
- application/x-json-stream
responses:
"200":
description: OK
schema:
$ref: '#/definitions/config.Message'
type: object
security:
- ApiKeyAuth: []
summary: Stream realtime messages
securityDefinitions:
ApiKeyAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"