2018-05-07 14:13:07 +00:00
|
|
|
---
|
|
|
|
servers:
|
|
|
|
- url: https://final-iot-backend.herokuapp.com/
|
|
|
|
description: Heroku deployed app for testing
|
|
|
|
|
|
|
|
basePath: ""
|
|
|
|
|
|
|
|
definitions:
|
|
|
|
|
|
|
|
username:
|
|
|
|
type: string
|
|
|
|
description: User's name in the system
|
|
|
|
default: testusername
|
|
|
|
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
format: email
|
|
|
|
description: User's registered email
|
|
|
|
default: user@test.com
|
|
|
|
|
|
|
|
password:
|
|
|
|
type: string
|
|
|
|
format: password
|
|
|
|
description: User's password
|
|
|
|
default: TestPassword1234
|
|
|
|
|
|
|
|
status:
|
|
|
|
type: string
|
|
|
|
description: Status of request
|
|
|
|
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
description: Descriptive message
|
|
|
|
|
|
|
|
Credentials:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- username
|
|
|
|
- password
|
|
|
|
properties:
|
|
|
|
username:
|
|
|
|
$ref: '#/definitions/username'
|
|
|
|
password:
|
|
|
|
$ref: '#/definitions/password'
|
|
|
|
|
|
|
|
User:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- username
|
|
|
|
- password
|
|
|
|
- email
|
|
|
|
properties:
|
|
|
|
username:
|
|
|
|
$ref: '#/definitions/username'
|
|
|
|
password:
|
|
|
|
$ref: '#/definitions/password'
|
|
|
|
email:
|
|
|
|
$ref: '#/definitions/email'
|
|
|
|
|
2018-05-07 15:17:19 +00:00
|
|
|
UnauthorizedError:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- status
|
|
|
|
- message
|
|
|
|
properties:
|
|
|
|
status:
|
|
|
|
$ref: '#/definitions/status'
|
|
|
|
default: error
|
|
|
|
message:
|
|
|
|
$ref: '#/definitions/message'
|
|
|
|
default: Unauthorized
|
|
|
|
|
2018-05-07 14:13:07 +00:00
|
|
|
Error:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- status
|
|
|
|
- message
|
|
|
|
properties:
|
|
|
|
status:
|
|
|
|
$ref: '#/definitions/status'
|
|
|
|
default: error
|
|
|
|
message:
|
|
|
|
$ref: '#/definitions/message'
|
|
|
|
default: Error message
|
|
|
|
|
2018-05-07 15:17:19 +00:00
|
|
|
securityDefinitions:
|
|
|
|
Bearer:
|
|
|
|
type: apiKey
|
|
|
|
name: Authorization
|
|
|
|
in: header
|
|
|
|
description: |
|
|
|
|
For accessing the API a valid JWT token must be passed in all the queries in
|
|
|
|
the 'Authorization' header as Bearer token.
|
|
|
|
|
|
|
|
|
|
|
|
A valid JWT token is generated by the API and returned as answer of a call
|
|
|
|
to the route /login giving a valid user & password.
|
|
|
|
|
|
|
|
|
|
|
|
The following syntax must be used in the 'Authorization' header :
|
|
|
|
|
|
|
|
Bearer xxxxxx.yyyyyyy.zzzzzz
|
|
|
|
|
|
|
|
security:
|
|
|
|
- Bearer: []
|
|
|
|
|
2018-05-07 14:13:07 +00:00
|
|
|
info:
|
|
|
|
description: Python (Flask) backend for IoT sysyem made for master's degree final project
|
|
|
|
title: IoT Backend
|
|
|
|
version: 0.0.1
|
|
|
|
swagger: '2.0'
|