Mainflux.mainflux/http/swagger.yaml

54 lines
1.8 KiB
YAML

swagger: "2.0"
info:
title: Mainflux http adapter
description: HTTP API for sending messages through communication channels.
version: "1.0.0"
paths:
/channels/{id}/messages:
post:
summary: Sends message to the communication channel
description: |
Sends message to the communication channel. Messages can be sent as
JSON formatted SenML or as blob.
tags:
- messages
consumes:
- "application/senml+json"
- "text/plain"
produces: []
parameters:
- name: Authorization
description: Access token.
in: header
type: string
required: true
- name: id
description: Unique channel identifier.
in: path
type: string
format: uuid
required: true
- name: message
description: |
Message to be distributed. Since the platform expects messages to be
properly formatted SenML in order to be post-processed, clients are
obliged to specify Content-Type header for each published message.
Note that all messages that aren't SenML will be accepted and published,
but no post-processing will be applied.
in: body
required: true
type: string
responses:
202:
description: Message is accepted for processing.
400:
description: Message discarded due to its malformed content.
403:
description: Message discarded due to missing or invalid credentials.
404:
description: Message discarded due to invalid channel id.
415:
description: Message discarded due to invalid or missing content type.
500:
description: Unexpected server-side error occured.