---
swagger: "2.0"
info:
title: "KYPO Adaptive Training Service - API Reference"
basePath: "/kypo-adaptive-training/api/v1"
tags:
- name: "Export Imports"
- name: "Phases"
- name: "Tasks"
- name: "Training definitions"
- name: "Training instances"
- name: "Training runs"
schemes:
- "http"
- "https"
paths:
/exports/training-definitions/{definitionId}:
get:
tags:
- "Export Imports"
summary: "Get exported training definitions and phase."
description: ""
operationId: "getExportedTrainingDefinitionAndPhases"
produces:
- "application/octet-stream"
parameters:
- name: "definitionId"
in: "path"
description: "Id of training definition"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "Training definitions and phase found and exported."
schema:
$ref: "#/definitions/TrainingDefinitionExportDTO"
404:
description: "Training definition not found."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/exports/training-instances/{instanceId}:
get:
tags:
- "Export Imports"
summary: "Archive training instance"
description: ""
operationId: "archiveTrainingInstance"
produces:
- "application/octet-stream"
parameters:
- name: "instanceId"
in: "path"
description: "Id of training instance"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "Training instance archived."
schema:
$ref: "#/definitions/TrainingInstanceArchiveDTO"
404:
description: "Training instance not found."
schema:
$ref: "#/definitions/ApiError"
409:
description: "Cannot archive instance that is not finished."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/imports/training-definitions:
post:
tags:
- "Export Imports"
summary: "Import training definition with phase."
description: ""
operationId: "importTrainingDefinition"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Training definition to be imported"
required: true
schema:
$ref: "#/definitions/ImportTrainingDefinitionDTO"
- name: "fields"
in: "query"
description: "Fields which should be returned in REST API response"
required: false
type: "string"
responses:
200:
description: "Training definition imported."
schema:
$ref: "#/definitions/TrainingDefinitionByIdDTO"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions:
get:
tags:
- "Training definitions"
summary: "Get all Training Definitions."
description: ""
operationId: "findAllTrainingDefinitions"
produces:
- "application/json"
parameters:
- name: "fields"
in: "query"
description: "Fields which should be returned in REST API response"
required: false
type: "string"
- name: "page"
in: "query"
description: "Results page you want to retrieve (0..N)"
required: false
type: "integer"
x-example: 0
- name: "size"
in: "query"
description: "Number of records per page."
required: false
type: "integer"
x-example: 20
- name: "sort"
in: "query"
description: "Sorting criteria in the format: property(,asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
type: "array"
items:
type: "string"
example: "asc"
collectionFormat: "multi"
x-example: "asc"
responses:
200:
description: "The requested resources have been found."
schema:
type: "array"
items:
$ref: "#/definitions/TrainingDefinitionByIdDTO"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
post:
tags:
- "Training definitions"
summary: "Create Training Definition"
description: ""
operationId: "createTrainingDefinition"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Training Definition to be created"
required: false
schema:
$ref: "#/definitions/TrainingDefinitionCreateDTO"
- name: "fields"
in: "query"
description: "Fields which should be returned in REST API response"
required: false
type: "string"
responses:
200:
description: "The Training definition has been created."
schema:
$ref: "#/definitions/TrainingDefinitionByIdDTO"
400:
description: "The provided training definition is not valid"
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
put:
tags:
- "Training definitions"
summary: "Update Training Definition"
description: "Only unreleased training definition can be updated"
operationId: "updateTrainingDefinition"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Training definition to be updated"
required: false
schema:
$ref: "#/definitions/TrainingDefinitionUpdateDTO"
responses:
200:
description: "The training definition has been updated."
400:
description: "The provided training definition is not valid"
schema:
$ref: "#/definitions/ApiError"
404:
description: "The training definition has not been found."
schema:
$ref: "#/definitions/ApiError"
409:
description: "Cannot edit released or archived training definition."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions/designers:
get:
tags:
- "Training definitions"
summary: "Get designers."
description: ""
operationId: "getDesigners"
produces:
- "application/json"
parameters:
- name: "givenName"
in: "query"
description: "Given name filter."
required: false
type: "string"
- name: "familyName"
in: "query"
description: "Family name filter."
required: false
type: "string"
- name: "page"
in: "query"
description: "Results page you want to retrieve (0..N)"
required: false
type: "integer"
x-example: 0
- name: "size"
in: "query"
description: "Number of records per page."
required: false
type: "integer"
x-example: 20
- name: "sort"
in: "query"
description: "Sorting criteria in the format: property(,asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
type: "array"
items:
type: "string"
example: "asc"
collectionFormat: "multi"
x-example: "asc"
responses:
200:
description: "The designers have been found."
schema:
$ref: "#/definitions/UserInfoRestResource"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions/for-organizers:
get:
tags:
- "Training definitions"
summary: "Get all Training Definitions for organizers."
description: ""
operationId: "findAllTrainingDefinitionsForOrganizers"
produces:
- "application/json"
parameters:
- name: "state"
in: "query"
description: "State of the training definition"
required: true
type: "string"
enum:
- "PRIVATED"
- "RELEASED"
- "ARCHIVED"
- "UNRELEASED"
- name: "fields"
in: "query"
description: "Fields which should be returned in REST API response"
required: false
type: "string"
- name: "page"
in: "query"
description: "Results page you want to retrieve (0..N)"
required: false
type: "integer"
x-example: 0
- name: "size"
in: "query"
description: "Number of records per page."
required: false
type: "integer"
x-example: 20
- name: "sort"
in: "query"
description: "Sorting criteria in the format: property(,asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
type: "array"
items:
type: "string"
example: "asc"
collectionFormat: "multi"
x-example: "asc"
responses:
200:
description: "The Training definitions have been found."
schema:
type: "array"
items:
$ref: "#/definitions/TrainingDefinitionInfoDTO"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions/organizers:
get:
tags:
- "Training definitions"
summary: "Get organizers."
description: ""
operationId: "getOrganizers"
produces:
- "application/json"
parameters:
- name: "givenName"
in: "query"
description: "Given name filter."
required: false
type: "string"
- name: "familyName"
in: "query"
description: "Family name filter."
required: false
type: "string"
- in: "body"
name: "body"
description: "Pagination support."
required: false
schema:
$ref: "#/definitions/Pageable"
- name: "page"
in: "query"
description: "Results page you want to retrieve (0..N)"
required: false
type: "integer"
x-example: 0
- name: "size"
in: "query"
description: "Number of records per page."
required: false
type: "integer"
x-example: 20
- name: "sort"
in: "query"
description: "Sorting criteria in the format: property(,asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
type: "array"
items:
type: "string"
example: "asc"
collectionFormat: "multi"
x-example: "asc"
responses:
200:
description: "The organizers have been found."
schema:
$ref: "#/definitions/UserInfoRestResource"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions/{definitionId}:
get:
tags:
- "Training definitions"
summary: "Get Training Definition by Id."
description: ""
operationId: "findTrainingDefinitionById"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "ID of training definition to be retrieved."
required: true
type: "integer"
format: "int64"
- name: "fields"
in: "query"
description: "Fields which should be returned in REST API response"
required: false
type: "string"
responses:
200:
description: "The Training definition has been found."
schema:
$ref: "#/definitions/TrainingDefinitionByIdDTO"
404:
description: "The Training definition has not been found."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
post:
tags:
- "Training definitions"
summary: "Clone training definition"
description: "Only released and archived training definitions can be cloned"
operationId: "cloneTrainingDefinition"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "Id of training definition to be cloned"
required: true
type: "integer"
format: "int64"
- name: "title"
in: "query"
description: "Title of cloned definition"
required: true
type: "string"
responses:
200:
description: "The Training definition has been cloned."
schema:
$ref: "#/definitions/TrainingDefinitionByIdDTO"
404:
description: "The Training definition has not been found."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
delete:
tags:
- "Training definitions"
summary: "Delete training definition"
description: "Released training definition cannot be deleted"
operationId: "deleteTrainingDefinition"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "Id of training definition to be deleted"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "The Training definition has been deleted."
404:
description: "The Training definition has not been found."
schema:
$ref: "#/definitions/ApiError"
409:
description: "Cannot delete released training definition."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions/{definitionId}/authors:
get:
tags:
- "Training definitions"
summary: "Get authors."
description: ""
operationId: "getAuthors"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "ID of the training definition which contains authors you want\
\ to retrieve."
required: true
type: "integer"
format: "int64"
- name: "givenName"
in: "query"
description: "Given name filter."
required: false
type: "string"
- name: "familyName"
in: "query"
description: "Family name filter."
required: false
type: "string"
- in: "body"
name: "body"
description: "Pagination support."
required: false
schema:
$ref: "#/definitions/Pageable"
- name: "page"
in: "query"
description: "Results page you want to retrieve (0..N)"
required: false
type: "integer"
x-example: 0
- name: "size"
in: "query"
description: "Number of records per page."
required: false
type: "integer"
x-example: 20
- name: "sort"
in: "query"
description: "Sorting criteria in the format: property(,asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
type: "array"
items:
type: "string"
example: "asc"
collectionFormat: "multi"
x-example: "asc"
responses:
200:
description: "The authors have been found."
schema:
$ref: "#/definitions/UserInfoRestResource"
404:
description: "The training definition has not been found"
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
put:
tags:
- "Training definitions"
summary: "Edit authors."
description: ""
operationId: "editAuthors"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "ID of training definition to be updated."
required: true
type: "integer"
format: "int64"
- name: "authorsAddition"
in: "query"
description: "Ids of the users to be added to the training definition."
required: false
type: "array"
items:
type: "integer"
format: "int64"
collectionFormat: "multi"
- name: "authorsRemoval"
in: "query"
description: "Ids of the users to be removed from the training definition."
required: false
type: "array"
items:
type: "integer"
format: "int64"
collectionFormat: "multi"
- name: "page"
in: "query"
description: "Results page you want to retrieve (0..N)"
required: false
type: "integer"
x-example: 0
- name: "size"
in: "query"
description: "Number of records per page."
required: false
type: "integer"
x-example: 20
- name: "sort"
in: "query"
description: "Sorting criteria in the format: property(,asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
type: "array"
items:
type: "string"
example: "asc"
collectionFormat: "multi"
x-example: "asc"
responses:
200:
description: "The authors have been updated."
schema:
$ref: "#/definitions/UserInfoRestResource"
404:
description: "The training definition has not been found."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions/{definitionId}/designers-not-in-training-definition:
get:
tags:
- "Training definitions"
summary: "Get designers not in given training definition."
description: ""
operationId: "findDesignersNotInGivenTrainingDefinition"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "ID of the training definition which do not contains authors\
\ you want to retrieve."
required: true
type: "integer"
format: "int64"
- name: "givenName"
in: "query"
description: "Given name filter."
required: false
type: "string"
- name: "familyName"
in: "query"
description: "Family name filter."
required: false
type: "string"
- name: "page"
in: "query"
description: "Results page you want to retrieve (0..N)"
required: false
type: "integer"
x-example: 0
- name: "size"
in: "query"
description: "Number of records per page."
required: false
type: "integer"
x-example: 20
- name: "sort"
in: "query"
description: "Sorting criteria in the format: property(,asc|desc). Default\
\ sort order is ascending. Multiple sort criteria are supported."
required: false
type: "array"
items:
type: "string"
example: "asc"
collectionFormat: "multi"
x-example: "asc"
responses:
200:
description: "The designers have been found."
schema:
$ref: "#/definitions/UserInfoRestResource"
404:
description: "The training definition has not been found."
schema:
$ref: "#/definitions/ApiError"
500:
description: "Unexpected condition was encountered."
schema:
$ref: "#/definitions/ApiError"
security:
- bearerAuth: []
/training-definitions/{definitionId}/phases:
get:
tags:
- "Phases"
summary: "Get all phase"
description: "Get all phase associated with specified training definition"
operationId: "getPhases"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "Training definition ID"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "Phases returned"
schema:
type: "object"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
post:
tags:
- "Phases"
summary: "Create a new phase"
description: "Creates a new default phase with a specified type"
operationId: "createPhase"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "Training definition ID"
required: true
type: "integer"
format: "int64"
- in: "body"
name: "body"
description: "Phase type"
required: true
schema:
$ref: "#/definitions/PhaseCreateDTO"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/AbstractLevelDTO"
201:
description: "Phase created"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
put:
tags:
- "Phases"
summary: "Update phases"
description: ""
operationId: "updatePhases"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "Phase ID"
required: true
type: "integer"
format: "int64"
- in: "body"
name: "body"
description: "List of phases to be updated"
required: false
schema:
type: "array"
items:
$ref: "#/definitions/AbstractPhaseUpdateDTO"
responses:
200:
description: "Phases updated"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
/training-definitions/{definitionId}/phases/{phaseIdFrom}/move-to/{newPosition}:
put:
tags:
- "Phases"
summary: "Move phase to specified order"
description: ""
operationId: "movePhaseToSpecifiedOrder"
produces:
- "application/json"
parameters:
- name: "definitionId"
in: "path"
description: "Training definition ID"
required: true
type: "integer"
format: "int64"
- name: "phaseIdFrom"
in: "path"
description: "Phase ID - from"
required: true
type: "integer"
format: "int64"
- name: "newPosition"
in: "path"
description: "Position (order) to which the phase should be moved"
required: true
type: "integer"
format: "int32"
responses:
200:
description: "Phase moved to specified order"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
/training-definitions/{definitionId}/phases/{phaseId}:
get:
tags:
- "Phases"
summary: "Get phase by ID"
description: ""
operationId: "getPhase"
produces:
- "application/json"
parameters:
- name: "phaseId"
in: "path"
description: "Phase ID"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "Phase returned"
schema:
$ref: "#/definitions/AbstractLevelDTO"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
delete:
tags:
- "Phases"
summary: "Remove phase by ID"
description: ""
operationId: "getPhase"
produces:
- "application/json"
parameters:
- name: "phaseId"
in: "path"
description: "Phase ID"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "Phase removed"
schema:
$ref: "#/definitions/AbstractLevelDTO"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
/training-definitions/{definitionId}/phases/{phaseId}/info:
put:
tags:
- "Phases"
summary: "Update info phase"
description: ""
operationId: "updateInfoPhase"
produces:
- "application/json"
parameters:
- name: "phaseId"
in: "path"
description: "Phase ID"
required: true
type: "integer"
format: "int64"
- in: "body"
name: "body"
description: "Info phase to be updated"
required: false
schema:
$ref: "#/definitions/InfoPhaseUpdateDTO"
responses:
200:
description: "Info phase updated"
schema:
$ref: "#/definitions/InfoPhaseDTO"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
/training-definitions/{definitionId}/phases/{phaseId}/questionnaire:
put:
tags:
- "Phases"
summary: "Update questionnaire phase"
description: ""
operationId: "updateQuestion"
produces:
- "application/json"
parameters:
- name: "phaseId"
in: "path"
description: "Phase ID"
required: true
type: "integer"
format: "int64"
- in: "body"
name: "body"
description: "Questionnaire to be updated"
required: false
schema:
$ref: "#/definitions/QuestionnaireUpdateDTO"
responses:
200:
description: "Questionnaire phase updated"
schema:
$ref: "#/definitions/QuestionnairePhaseDTO"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
/training-definitions/{definitionId}/phases/{phaseId}/tasks:
post:
tags:
- "Tasks"
summary: "Create a new task in a phase"
description: "Creates a new default task in a specified training phase"
operationId: "createTask"
produces:
- "application/json"
parameters:
- name: "phaseId"
in: "path"
description: "Training phase ID"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
schema:
$ref: "#/definitions/TaskDTO"
201:
description: "Task created"
500:
description: "Unexpected application error"
security:
- bearerAuth: []
/training-definitions/{definitionId}/phases/{phaseId}/tasks/{taskIdFrom}/move-to/{newPosition}:
put:
tags:
- "Tasks"
summary: "Move task to specified order"
description: ""
operationId: "moveTaskToSpecifiedOrder"
produces:
- "application/json"
parameters: