IOT Dashboard backend API

IOT device management with MQTT and ASP.NET
More information: https://muph0.github.io/iot-dash-backend/
Contact Info: kytka.honza@gmail.com
Version: v1
BasePath:

Access

  1. APIKey KeyParamName:Authorization KeyInQuery:false KeyInHeader:true

Methods

[ Jump to Models ]

Table of Contents

Identity

Interface

Identity

Up
get /api/v1/identity
Get information about the authorization token bearer. (getUser)

Return type

User

Example data

Content-Type: application/json
{
  "id" : "id",
  "userName" : "userName",
  "email" : "email"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success User

401

Unauthorized

Up
post /api/v1/identity/login
Get a new authorization token for the user. (login)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

UserLoginRequest UserLoginRequest (optional)
Body Parameter

Return type

AuthResponse

Example data

Content-Type: application/json
{
  "success" : true,
  "errors" : [ "errors", "errors" ],
  "token" : "token",
  "refreshToken" : "refreshToken"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success AuthResponse

400

Bad Request AuthResponse

Up
post /api/v1/identity/refresh
Provide a new token pair in exchange for a valid refresh token and an expired JWT token. (refresh)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

RefreshTokenRequest RefreshTokenRequest (optional)
Body Parameter

Return type

AuthResponse

Example data

Content-Type: application/json
{
  "success" : true,
  "errors" : [ "errors", "errors" ],
  "token" : "token",
  "refreshToken" : "refreshToken"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success AuthResponse

400

Bad Request AuthResponse

Interface

Up
post /api/v1/interface
Create a new interface. (createInterface)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

InterfaceCreateRequest InterfaceCreateRequest (optional)
Body Parameter

Return type

InterfaceResponse

Example data

Content-Type: application/json
{
  "success" : true,
  "interface" : {
    "historyEnabled" : true,
    "expression" : "expression",
    "topic" : "topic",
    "id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "value" : 0.8008281904610115
  },
  "errors" : [ "errors", "errors" ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

201

Success InterfaceResponse

401

Unauthorized

400

Bad Request

Up
delete /api/v1/interface/{ifaceId}
Delete a specific interface. (deleteInterface)

Path parameters

ifaceId (required)
Path Parameter — default: null

Return type

InterfaceResponse

Example data

Content-Type: application/json
{
  "success" : true,
  "interface" : {
    "historyEnabled" : true,
    "expression" : "expression",
    "topic" : "topic",
    "id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "value" : 0.8008281904610115
  },
  "errors" : [ "errors", "errors" ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success InterfaceResponse

Up
post /api/v1/interface/{ifaceId}/history
Get interface history over a specified time period with given point density. (getHistory)

Path parameters

ifaceId (required)
Path Parameter — default: null

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

HistoryRequest HistoryRequest (optional)
Body Parameter

Return type

HistoryResponse

Example data

Content-Type: application/json
{
  "success" : true,
  "values" : [ {
    "average" : 1.4658129805029452,
    "min" : 0.8008281904610115,
    "max" : 6.027456183070403,
    "timeUTC" : "2000-01-23T04:56:07.000+00:00"
  }, {
    "average" : 1.4658129805029452,
    "min" : 0.8008281904610115,
    "max" : 6.027456183070403,
    "timeUTC" : "2000-01-23T04:56:07.000+00:00"
  } ],
  "errors" : [ "errors", "errors" ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success HistoryResponse

Up
get /api/v1/interface/{ifaceId}
Get information about the specific interface. (getInterface)

Path parameters

ifaceId (required)
Path Parameter — default: null

Return type

IotInterface

Example data

Content-Type: application/json
{
  "historyEnabled" : true,
  "expression" : "expression",
  "topic" : "topic",
  "id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "value" : 0.8008281904610115
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success IotInterface

401

Unauthorized

404

Not Found

Up
get /api/v1/interface
Get information about all interfaces. (getInterfaces)

Return type

array[IotInterface]

Example data

Content-Type: application/json
{
  "historyEnabled" : true,
  "expression" : "expression",
  "topic" : "topic",
  "id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "value" : 0.8008281904610115
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success

401

Unauthorized

Up
patch /api/v1/interface/{ifaceId}
Update one or more fields of the specified interface. (updateInterface)

Path parameters

ifaceId (required)
Path Parameter — default: null

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

InterfacePatchRequest InterfacePatchRequest (optional)
Body Parameter

Return type

InterfaceResponse

Example data

Content-Type: application/json
{
  "success" : true,
  "interface" : {
    "historyEnabled" : true,
    "expression" : "expression",
    "topic" : "topic",
    "id" : "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "value" : 0.8008281904610115
  },
  "errors" : [ "errors", "errors" ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Success InterfaceResponse

Models

[ Jump to Methods ]

Table of Contents

  1. AuthResponse -
  2. HistoryEntry -
  3. HistoryEntryUpdate -
  4. HistoryRequest -
  5. HistoryResponse -
  6. InterfaceCreateRequest -
  7. InterfaceKind -
  8. InterfacePatchRequest -
  9. InterfaceResponse -
  10. IotInterface -
  11. RefreshTokenRequest -
  12. User -
  13. UserLoginRequest -

AuthResponse - Up

Represents result of an authentication
success
errors (optional)
token (optional)
String Newly issued JWT token.
refreshToken (optional)
String One-time use refresh token.

HistoryEntry - Up

Represents a measurement event in time.
timeUTC
Date format: date-time
min
Double format: double
max
Double format: double
average
Double format: double

HistoryEntryUpdate - Up

Represents an server-to-client event. This event is fired when a new IotDash.Contracts.V1.Model.HistoryEntry is created.
entry
interfaceId
UUID Interface to which this entry relates. format: uuid

HistoryRequest - Up

REST model of a history query. Represents a time interval with point density information.
fromUTC
Date Start of the time interval. format: date-time
toUTC
Date End of the time interval. format: date-time
pointCount (optional)
Integer Maximum number of points in the interval. If exceeded, poins will be recalculated to uniformly cover the interval. format: int32

HistoryResponse - Up

success
errors (optional)
values (optional)

InterfaceCreateRequest - Up

topic (optional)
expression (optional)
historyEnabled (optional)
kind

InterfaceKind - Up

Enumeration of different device types as presented over Rest API.

InterfacePatchRequest - Up

topic (optional)
expression (optional)
historyEnabled (optional)
kind (optional)

InterfaceResponse - Up

success
errors (optional)
interface (optional)

IotInterface - Up

Represents an Iot device.
id
UUID format: uuid
topic (optional)
kind
expression (optional)
value
Double format: double
historyEnabled

RefreshTokenRequest - Up

token
refreshToken

User - Up

Represents a user.
email
id
userName

UserLoginRequest - Up

username
password