2017-09-23 01:55:29 +02:00
|
|
|
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"
|
2018-03-11 18:06:01 +01:00
|
|
|
- "text/plain"
|
2017-09-23 01:55:29 +02:00
|
|
|
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
|
2018-03-11 18:06:01 +01:00
|
|
|
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.
|
2017-09-23 01:55:29 +02:00
|
|
|
in: body
|
|
|
|
required: true
|
2020-09-09 13:05:36 +02:00
|
|
|
schema:
|
|
|
|
$ref: '#/definitions/SenMLArray'
|
2017-09-23 01:55:29 +02:00
|
|
|
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.
|
2018-04-11 13:48:09 +02:00
|
|
|
404:
|
|
|
|
description: Message discarded due to invalid channel id.
|
2017-09-23 01:55:29 +02:00
|
|
|
415:
|
2018-03-11 18:06:01 +01:00
|
|
|
description: Message discarded due to invalid or missing content type.
|
2017-09-23 01:55:29 +02:00
|
|
|
500:
|
2020-06-29 21:48:14 +03:00
|
|
|
description: Unexpected server-side error occurred.
|
2020-09-09 13:05:36 +02:00
|
|
|
definitions:
|
|
|
|
SenMLRecord:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
bn:
|
|
|
|
type: string
|
|
|
|
description: Base Name
|
|
|
|
bt:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Base Time
|
|
|
|
bu:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Base Unit
|
|
|
|
bv:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Base Value
|
|
|
|
bs:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Base Sum
|
|
|
|
bver:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Version
|
|
|
|
n:
|
|
|
|
type: string
|
|
|
|
description: Name
|
|
|
|
u:
|
|
|
|
type: string
|
|
|
|
description: Unit
|
|
|
|
v:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Value
|
|
|
|
vs:
|
|
|
|
type: string
|
|
|
|
description: String Value
|
|
|
|
vb:
|
|
|
|
type: boolean
|
|
|
|
description: Boolean Value
|
|
|
|
vd:
|
|
|
|
type: string
|
|
|
|
description: Data Value
|
|
|
|
s:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Value Sum
|
|
|
|
t:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Time
|
|
|
|
ut:
|
|
|
|
type: number
|
|
|
|
format: double
|
|
|
|
description: Update Time
|
|
|
|
SenMLArray:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: "#/definitions/SenMLRecord"
|