expqr/doc/swagger.yaml

423 lines
11 KiB
YAML

openapi: 3.0.0
info:
description: API for handling EXP360 QR Code generation and analysis
version: "0.1"
title: EXPQR
contact:
email: support@kumi.email
tags:
- name: series
description: Operations on series of codes to be used in a single shoot
- name: code
description: Operations on individual QR codes
- name: content
description: Operations on content elements including QR codes
paths:
/series:
post:
tags:
- series
summary: Create a new code series
description: ""
operationId: addSeries
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Series"
description: "(Partial) `Series` object to be created, required field: `title`"
required: true
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Series"
"/series/{id}":
get:
tags:
- series
summary: Find Series by ID or UUID
description: Returns a single Series object
operationId: getSeriesByID
parameters:
- name: id
in: path
description: ID or UUID of series to return
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Series"
"400":
description: Invalid ID supplied
"404":
description: Series not found
post:
tags:
- series
summary: Modifies an existing Series object
description: ""
operationId: modifySeriesByID
parameters:
- name: id
in: path
description: ID or UUID of `Series` object to be modified
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Series"
description: "Partial `Series` object, allowed fields: `title`, `description`"
required: true
responses:
"405":
description: Invalid input
delete:
tags:
- series
summary: Deletes a Series object
description: ""
operationId: deleteSeries
parameters:
- name: id
in: path
description: ID or UUID of `Series` object to delete
required: true
schema:
type: string
responses:
"400":
description: Invalid ID supplied
"404":
description: Series not found
"/series/{id}/codes":
get:
tags:
- series
summary: Return all QR codes associated with Series
parameters:
- name: id
in: path
description: ID or UUID of `Series` object to return codes for
required: true
schema:
type: string
responses:
200:
description: List of `Code` objects associated with `Series`
post:
tags:
- series
summary: creates new QR codes for Series
description: ""
operationId: createCodes
parameters:
- name: id
in: path
description: ID or UUID of the `Series` object to create codes for
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Code"
description: (Partial) `Code` objects to be created, forbidden parameter: `series`
required: true
responses:
"200":
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Code"
"/code/":
post:
tags:
- code
summary: create new Code objects
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Code"
responses:
"200":
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Code"
"/code/{uuid}":
get:
tags:
- code
summary: returns a Code object by its UUID
operationId: getCodeByUUID
parameters:
- name: uuid
in: path
description: UUID of the `Code` object to return
required: true
schema:
type: string
format: uuid
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Code"
delete:
tags:
- code
summary: delete a Code object by its UUID
operationId: deleteCodeByUUID
parameters:
- name: uuid
in: path
description: UUID of the `Code` object to delete
required: true
schema:
type: string
format: uuid
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Code"
post:
tags:
- code
summary: modify a Code object by its UUID
operationId: modifyCodeByUUID
parameters:
- name: uuid
in: path
description: UUID of the `Code` object to modify
required: true
schema:
type: string
format: uuid
requestBody:
$ref: "#/components/requestBodies/modifyCodeByUUIDBody"
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Code"
"/code/{seriesid}/{codeid}":
get:
tags:
- code
summary: returns a Code object by its Series ID and Code ID
operationId: getCodeByID
parameters:
- name: seriesid
in: path
description: ID or UUID of the `Series` the `Code` object to return is part of
required: true
schema:
type: string
- name: codeid
in: path
description: ID of the `Code` object to return
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Code"
delete:
tags:
- code
summary: delete a Code object by its Series ID and Code ID
operationId: deleteCodeByID
parameters:
- name: seriesid
in: path
description: ID or UUID of the `Series` the `Code` object to delete is part of
required: true
schema:
type: string
- name: codeid
in: path
description: ID of the `Code` object to delete
required: true
schema:
type: string
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Code"
post:
tags:
- code
summary: modify a Code object by its Series ID and Code ID
operationId: modifyCodeByID
parameters:
- name: seriesid
in: path
description: ID or UUID of the `Series` the `Code` object to modify is part of
required: true
schema:
type: string
- name: codeid
in: path
description: ID of the `Code` object to modify
required: true
schema:
type: string
requestBody:
$ref: "#/components/requestBodies/modifyCodeByUUIDBody"
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Code"
/content:
post:
tags:
- content
summary: analyze new media item and return content
operationId: createContent
requestBody:
content:
application/json:
schema:
url:
type: string
path:
type: string
uuid:
type: string
format: uuid
required: true
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Media"
"/content/{uuid}":
get:
tags:
- content
summary: fetch details on media item by UUID
parameters:
- name: uuid
in: path
description: UUID of the `Media` item to retrieve
schema:
type: string
required: true
responses:
"200":
description: successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/Media"
security:
- api_key: []
servers:
- url: https://expqr.kumi.live/api
components:
requestBodies:
modifyCodeByUUIDBody:
content:
application/json:
schema:
type: string
description: New title of the `Code` object
required: true
securitySchemes:
api_key:
type: apiKey
name: api_key
in: header
schemas:
Series:
type: object
required:
- title
properties:
title:
type: string
description:
type: string
id:
type: string
uuid:
type: string
format: uuid
Code:
type: object
required:
- title
properties:
title:
type: string
id:
type: string
uuid:
type: string
format: uuid
series:
$ref: "#/components/schemas/Series"
Media:
type: object
required:
- uuid
properties:
uuid:
type: string
format: uuid
content:
$ref: "#/components/schemas/Content"
Content:
type: object
required:
- literal
properties:
literal:
type: string
code:
$ref: "#/components/schemas/Code"