api_v1.4/hub_api/docs/openapi-specs.yml

205 lines
5.5 KiB
YAML
Raw Normal View History

info:
2023-01-23 12:29:41 -05:00
title: CERC API Swagger - OpenAPI 3.0
description: NextGen Cities Institute API
termsOfService: http://swagger.io/terms/
contact:
2023-02-13 08:09:48 -05:00
email: peteryefi@gmail.com
version: 1.4
externalDocs:
description: Find out more about Swagger
url: http://swagger.io
paths:
2023-01-24 05:38:45 -05:00
/v1.4/uptime:
get:
2023-02-13 08:09:48 -05:00
parameters:
[]
2023-01-24 05:38:45 -05:00
tags:
- Uptime
summary: API uptime
operationId: uptime
description: Retrieve current API uptime
responses:
'200':
description: Request sucessful
content:
application/json:
schema:
$ref: '#/components/schemas/uptime'
/v1.4/session/start:
put:
parameters:
- in: header
name: username
schema:
type: string
required: true
description: the application username accessing this API
- in: header
name: password
schema:
type: string
required: true
description: the password for the user accessing this API
- in: header
name: application_id
schema:
type: string
required: true
description: the Id of the application accessing this API
tags:
- Session start
summary: Starts an user session
operationId: session_start
description: Authentication and initialisation of a user session in the Api
responses:
'200':
description: Succeed
content:
application/json:
schema:
$ref: '#/components/schemas/succeed'
headers:
token:
type: string
format: uuid
description: Token expected in next operation header
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
'403':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
/v1.4/session/keep_alive:
put:
security:
- session_id: []
- token: []
- application_id: []
parameters:
- in: header
name: session_id
schema:
type: string
required: true
description: the Id of the current session
- in: header
name: token
schema:
type: string
required: true
description: the last token received from the API
- in: header
name: application_id
schema:
type: string
required: true
description: the Id of the application accessing this API
tags:
- Keep alive
summary: Keep the current user session alive
operationId: keep_alive
description: Refresh and keep the current session alive and renew the token
responses:
'200':
description: Succeed
content:
application/json:
schema:
$ref: '#/components/schemas/succeed'
headers:
token:
type: string
format: uuid
description: Token expected in next operation header
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
'403':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
/v1.4/session/end:
put:
security:
- session_id: []
- token: []
- application_id: []
parameters:
- in: header
name: session_id
schema:
type: string
required: true
description: the Id of the current session
- in: header
name: token
schema:
type: string
required: true
description: the last token received from the API
- in: header
name: application_id
schema:
type: string
required: true
description: the Id of the application accessing this API
tags:
- End session
summary: Ends the current user session
operationId: session_end
description: End the current user session and free the alocated resources
responses:
'200':
description: Succeed
content:
application/json:
schema:
$ref: '#/components/schemas/succeed'
headers:
token:
type: string
format: uuid
description: Token expected in next operation header
example: '77e1c83b-7bb0-437b-bc50-a7a58e5660ac'
'403':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/unauthorized'
components:
securitySchemes:
session_id:
type: apiKey
in: header
name: session_id
application_id:
type: apiKey
in: header
name: application_id
token:
type: apiKey
in: header
name: token
schemas:
uptime:
type: object
properties:
uptime:
type: string
format: hh:mm:ss.ms
example: '00:09:53.600281'
unauthorized:
type: object
properties:
error:
type: string
example: 'unauthorized'
succeed:
type: object
properties:
succeed:
type: string
example: 'OK'