university-final-iot-backend/app/api/resources/swagger/create_token_spec.yaml

38 lines
801 B
YAML
Raw Normal View History

2018-05-07 14:13:07 +00:00
Creates new token for given account
Requires a registered User with a valid username and password
Creates a JWT token and returns it or returns an error if credentials are wrong
---
tags:
- Token
- Account
parameters:
- in: body
name: body
required: true
schema:
type: object
required:
- user
properties:
user:
$ref: '#/definitions/Credentials'
security: []
2018-05-07 14:13:07 +00:00
responses:
200:
description: Successful creation
schema:
required:
- status
- token
properties:
status:
type: string
default: success
token:
type: string
description: JWT token
401:
description: Bad credentials
schema:
$ref: '#/definitions/UnauthorizedError'