2019-12-20 14:32:04 -05:00
openapi : "3.0.2"
2019-11-19 15:57:46 -05:00
info :
version : 1.0 .0
title : Workflow Microservice
license :
name : MIT
servers :
- url : http://localhost:5000/v1.0
2020-03-24 14:15:21 -04:00
security :
- jwt : [ 'secret' ]
2019-11-19 15:57:46 -05:00
paths :
2020-05-31 16:49:39 -04:00
/login :
2020-02-18 16:38:56 -05:00
get :
2020-05-31 16:49:39 -04:00
operationId : crc.api.user.login
summary : In production, logs the user in via SSO. If not in production, logs in as a specific user for testing.
2020-03-24 14:15:21 -04:00
security : [ ] # Disable security for this endpoint only.
2020-02-20 15:35:07 -05:00
parameters :
- name : uid
2020-02-21 11:24:39 -05:00
in : query
2020-02-20 15:35:07 -05:00
required : false
schema :
type : string
2020-05-31 16:49:39 -04:00
- name : redirect_url
2020-02-24 16:59:16 -05:00
in : query
required : false
schema :
type : string
2020-02-18 16:38:56 -05:00
tags :
- Users
responses :
'304' :
description : Redirection to the hosted frontend with an auth_token header.
2022-01-11 15:30:22 -05:00
2020-02-18 16:38:56 -05:00
/user :
2020-07-29 22:47:47 -04:00
parameters :
- name : admin_impersonate_uid
in : query
required : false
description : For admins, the unique uid of an existing user to impersonate.
schema :
type : string
2020-02-18 16:38:56 -05:00
get :
operationId : crc.api.user.get_current_user
summary : Returns the current user.
tags :
- Users
responses :
'200' :
2020-07-29 22:47:47 -04:00
description : The currently-authenticated user, or, if the current user is an admin and admin_impersonate_uid is provided, this will be the user with the given uid.
2020-02-18 16:38:56 -05:00
content :
application/json :
schema :
$ref : "#/components/schemas/User"
2022-01-11 15:30:22 -05:00
2020-07-29 22:47:47 -04:00
/list_users :
get :
operationId : crc.api.user.get_all_users
security :
- auth_admin : [ 'secret' ]
summary : Returns a list of all users in the database.
tags :
- Users
responses :
'200' :
description : All users in the database.
content :
application/json :
schema :
type : array
2021-04-02 17:10:05 -04:00
items :
$ref : "#/components/schemas/User"
2021-04-20 08:12:27 -04:00
# /v1.0/document_directory/{study_id}
/document_directory/{study_id}:
parameters :
- name : study_id
required : true
in : path
description : The unique id of a study.
schema :
type : integer
- name : workflow_id
in : query
required : false
schema :
type : integer
get :
2021-07-06 13:10:20 -04:00
operationId : crc.api.document.get_document_directory
2021-04-20 08:12:27 -04:00
summary : Returns a directory of all files for study in a nested structure
tags :
- Document Categories
responses :
'200' :
description : All IRB Categories defined in the file document.
content :
application/json :
schema :
2021-04-21 14:00:19 -04:00
type : array
items :
$ref : "#/components/schemas/DocumentDirectory"
2021-04-20 08:12:27 -04:00
2021-10-28 16:19:39 -04:00
# Context-less LDAP Lookup
/ldap :
parameters :
- name : query
in : query
required : false
description : The string to search for in the Value column of the lookup table.
schema :
type : string
- name : limit
in : query
required : false
description : The total number of records to return, defaults to 10.
schema :
type : integer
get :
operationId : crc.api.workflow.lookup_ldap
summary : Returns a list of LDAP users, with a given query.
tags :
- Users
responses :
'200' :
description : An array of all LDAP users.
content :
application/json :
schema :
type : array
2019-12-11 16:54:24 -05:00
# /v1.0/study
/study :
2019-11-19 15:57:46 -05:00
get :
A major refactor of how we search and store files, as there was a lot of confusing bits in here.
From an API point of view you can do the following (and only the following)
/files?workflow_spec_id=x
* You can find all files associated with a workflow_spec_id, and add a file with a workflow_spec_id
/files?workflow_id=x
* You can find all files associated with a workflow_id, and add a file that is directly associated with the workflow
/files?workflow_id=x&form_field_key=y
* You can find all files associated with a form element on a running workflow, and add a new file.
Note: you can add multiple files to the same form_field_key, IF they have different file names. If the same name, the original file is archived,
and the new file takes its place.
The study endpoints always return a list of the file metadata associated with the study. Removed /studies-files, but there is an
endpoint called
/studies/all - that returns all the studies in the system, and does include their files.
On a deeper level:
The File model no longer contains:
- study_id,
- task_id,
- form_field_key
Instead, if the file is associated with workflow - then that is the one way it is connected to the study, and we use this relationship to find files for a study.
A file is never associated with a task_id, as these change when the workflow is reloaded.
The form_field_key must match the irb_doc_code, so when requesting files for a form field, we just look up the irb_doc_code.
2020-05-28 08:27:26 -04:00
operationId : crc.api.study.user_studies
2019-12-11 16:54:24 -05:00
summary : Provides a list of studies related to the current user.
2019-11-19 15:57:46 -05:00
tags :
2019-12-18 14:02:17 -05:00
- Studies
2019-12-11 16:54:24 -05:00
responses :
'200' :
description : An array of studies, ordered by the last modified date.
content :
application/json :
schema :
2020-07-29 22:47:47 -04:00
type : array
2021-04-02 17:10:05 -04:00
items :
$ref : "#/components/schemas/Study"
2020-01-03 11:44:24 -05:00
post :
2020-01-14 15:39:54 -05:00
operationId : crc.api.study.add_study
2020-01-03 11:44:24 -05:00
summary : Creates a new study with the given parameters.
tags :
- Studies
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/Study'
responses :
'200' :
description : Study created successfully.
content :
application/json :
schema :
A major refactor of how we search and store files, as there was a lot of confusing bits in here.
From an API point of view you can do the following (and only the following)
/files?workflow_spec_id=x
* You can find all files associated with a workflow_spec_id, and add a file with a workflow_spec_id
/files?workflow_id=x
* You can find all files associated with a workflow_id, and add a file that is directly associated with the workflow
/files?workflow_id=x&form_field_key=y
* You can find all files associated with a form element on a running workflow, and add a new file.
Note: you can add multiple files to the same form_field_key, IF they have different file names. If the same name, the original file is archived,
and the new file takes its place.
The study endpoints always return a list of the file metadata associated with the study. Removed /studies-files, but there is an
endpoint called
/studies/all - that returns all the studies in the system, and does include their files.
On a deeper level:
The File model no longer contains:
- study_id,
- task_id,
- form_field_key
Instead, if the file is associated with workflow - then that is the one way it is connected to the study, and we use this relationship to find files for a study.
A file is never associated with a task_id, as these change when the workflow is reloaded.
The form_field_key must match the irb_doc_code, so when requesting files for a form field, we just look up the irb_doc_code.
2020-05-28 08:27:26 -04:00
type : array
items :
$ref : "#/components/schemas/Study"
/study/all :
2020-05-22 09:46:03 -06:00
get :
A major refactor of how we search and store files, as there was a lot of confusing bits in here.
From an API point of view you can do the following (and only the following)
/files?workflow_spec_id=x
* You can find all files associated with a workflow_spec_id, and add a file with a workflow_spec_id
/files?workflow_id=x
* You can find all files associated with a workflow_id, and add a file that is directly associated with the workflow
/files?workflow_id=x&form_field_key=y
* You can find all files associated with a form element on a running workflow, and add a new file.
Note: you can add multiple files to the same form_field_key, IF they have different file names. If the same name, the original file is archived,
and the new file takes its place.
The study endpoints always return a list of the file metadata associated with the study. Removed /studies-files, but there is an
endpoint called
/studies/all - that returns all the studies in the system, and does include their files.
On a deeper level:
The File model no longer contains:
- study_id,
- task_id,
- form_field_key
Instead, if the file is associated with workflow - then that is the one way it is connected to the study, and we use this relationship to find files for a study.
A file is never associated with a task_id, as these change when the workflow is reloaded.
The form_field_key must match the irb_doc_code, so when requesting files for a form field, we just look up the irb_doc_code.
2020-05-28 08:27:26 -04:00
operationId : crc.api.study.all_studies
summary : Provides a list of studies
2020-05-22 09:46:03 -06:00
tags :
- Studies
responses :
'200' :
description : An array of studies, with submitted files, ordered by the last modified date.
content :
application/json :
schema :
A major refactor of how we search and store files, as there was a lot of confusing bits in here.
From an API point of view you can do the following (and only the following)
/files?workflow_spec_id=x
* You can find all files associated with a workflow_spec_id, and add a file with a workflow_spec_id
/files?workflow_id=x
* You can find all files associated with a workflow_id, and add a file that is directly associated with the workflow
/files?workflow_id=x&form_field_key=y
* You can find all files associated with a form element on a running workflow, and add a new file.
Note: you can add multiple files to the same form_field_key, IF they have different file names. If the same name, the original file is archived,
and the new file takes its place.
The study endpoints always return a list of the file metadata associated with the study. Removed /studies-files, but there is an
endpoint called
/studies/all - that returns all the studies in the system, and does include their files.
On a deeper level:
The File model no longer contains:
- study_id,
- task_id,
- form_field_key
Instead, if the file is associated with workflow - then that is the one way it is connected to the study, and we use this relationship to find files for a study.
A file is never associated with a task_id, as these change when the workflow is reloaded.
The form_field_key must match the irb_doc_code, so when requesting files for a form field, we just look up the irb_doc_code.
2020-05-28 08:27:26 -04:00
type : array
items :
$ref : "#/components/schemas/Study"
2019-12-18 14:02:17 -05:00
/study/{study_id}:
2020-01-31 11:33:31 -05:00
parameters :
- name : study_id
in : path
required : true
description : The id of the study for which workflows should be returned.
schema :
type : integer
format : int32
2021-04-30 11:55:12 -04:00
- name : update_status
in : query
required : false
description : If set to true, will synch the study with protocol builder and assure the status of all workflows is up to date (expensive).
schema :
type : boolean
2019-12-11 16:54:24 -05:00
get :
2020-01-14 15:39:54 -05:00
operationId : crc.api.study.get_study
2019-12-18 14:02:17 -05:00
summary : Provides a single study
2019-12-11 16:54:24 -05:00
tags :
2019-12-18 14:02:17 -05:00
- Studies
2019-12-11 16:54:24 -05:00
responses :
'200' :
2019-12-18 14:02:17 -05:00
description : An Study Object
2019-12-11 16:54:24 -05:00
content :
application/json :
schema :
2019-12-18 14:02:17 -05:00
$ref : "#/components/schemas/Study"
2020-03-09 15:12:40 -04:00
delete :
operationId : crc.api.study.delete_study
2020-05-31 16:49:39 -04:00
security :
2020-06-11 11:29:58 -04:00
- auth_admin : [ 'secret' ]
2020-03-09 15:12:40 -04:00
summary : Removes the given study completely.
tags :
- Studies
responses :
'204' :
description : The study has been removed.
2020-01-31 11:33:31 -05:00
put :
2020-01-14 15:39:54 -05:00
operationId : crc.api.study.update_study
2020-01-03 11:44:24 -05:00
summary : Updates an existing study with the given parameters.
tags :
- Studies
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/Study'
responses :
'200' :
description : Study updated successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/Study"
2021-07-22 15:08:28 -04:00
/study/{study_id}/associates:
2021-03-22 17:30:49 -04:00
parameters :
- name : study_id
in : path
required : true
2021-07-22 14:36:00 -04:00
description : The id of the study for which associates should be returned.
2021-03-22 17:30:49 -04:00
schema :
type : integer
format : int32
get :
operationId : crc.api.study.get_study_associates
2021-07-22 14:36:00 -04:00
summary : Provides a list of associates for a particular study
2021-03-22 17:30:49 -04:00
tags :
- Studies
responses :
'200' :
2021-07-22 14:36:00 -04:00
description : list of Study Associate Objects
2021-03-22 17:30:49 -04:00
content :
application/json :
schema :
2021-07-22 14:36:00 -04:00
type : array
items :
$ref : "#/components/schemas/StudyAssociate"
2022-01-10 13:16:54 -05:00
/study/{study_id}/log:
parameters :
- name : study_id
in : path
required : true
description : The id of the study for which logs should be returned.
schema :
type : integer
format : int32
put :
operationId : crc.api.study.get_logs_for_study
summary : Provides a list of logged events that occured within a study
tags :
- Studies
requestBody :
description : Log Pagination Request
required : true
content :
application/json :
schema :
$ref : "#/components/schemas/PaginatedTaskLog"
responses :
'200' :
description : list of Study logs - events that have occured within a study.
2021-03-22 17:30:49 -04:00
content :
application/json :
schema :
2021-07-22 14:36:00 -04:00
type : array
items :
2022-01-10 13:16:54 -05:00
$ref : "#/components/schemas/TaskLog"
2022-03-09 13:07:56 -05:00
/study/{study_id}/log/download:
parameters :
- name : study_id
in : path
required : true
description : The id of the study for which logs should be returned.
schema :
type : integer
format : int32
2022-03-12 16:19:07 -05:00
- name : auth_token
in : query
required : true
description : User Auth Toeken
schema :
type : string
2022-03-12 14:23:22 -05:00
get :
2022-03-09 13:07:56 -05:00
operationId : crc.api.study.download_logs_for_study
summary : Returns a csv file of logged events that occured within a study
2022-03-12 16:19:07 -05:00
security : [ ] # Will verify manually with provided Auth Token.
2022-03-09 13:07:56 -05:00
tags :
- Studies
responses :
'200' :
2022-03-12 16:19:07 -05:00
description : Returns the spreadsheet file of logged events
2022-03-09 13:07:56 -05:00
content :
application/octet-stream :
schema :
type : string
format : binary
2019-12-18 14:02:17 -05:00
/workflow-specification :
get :
2020-01-14 15:39:54 -05:00
operationId : crc.api.workflow.all_specifications
2019-12-18 14:02:17 -05:00
summary : Provides a list of workflows specifications that can be added to a study manually. Please note that Protocol Builder will handle this most of the time.
tags :
2020-01-30 09:11:17 -05:00
- Workflow Specifications
2021-07-26 13:00:11 -04:00
parameters :
- name : libraries
in : query
required : false
description : True if we should return just library schemas
schema :
type : boolean
- name : standalone
in : query
required : false
description : True if we should return just standalone schemas
schema :
type : boolean
2019-12-18 14:02:17 -05:00
responses :
'200' :
description : An array of workflow specifications
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/WorkflowSpec"
2020-01-13 21:43:09 -05:00
post :
2020-01-14 15:39:54 -05:00
operationId : crc.api.workflow.add_workflow_specification
2020-01-13 21:43:09 -05:00
summary : Creates a new workflow specification with the given parameters.
tags :
2020-01-30 09:11:17 -05:00
- Workflow Specifications
2020-01-13 21:43:09 -05:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpec'
responses :
'200' :
description : Workflow specification created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
2021-07-22 10:20:34 -04:00
/workflow-specification/{spec_id}/library/{library_id}:
parameters :
- name : spec_id
in : path
required : true
description : The unique id of an existing workflow specification.
schema :
type : string
- name : library_id
in : path
required : true
description : The unique id of an existing library specification.
schema :
type : string
post :
operationId : crc.api.workflow.add_workflow_spec_library
summary : Adds a library to a workflow spec
tags :
- Workflow Specifications
responses :
'200' :
description : Workflow specification.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
delete :
operationId : crc.api.workflow.drop_workflow_spec_library
summary : Delete a library from a workflow
tags :
- Workflow Specifications
responses :
'200' :
description : Workflow specification.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
2020-01-14 14:10:53 -05:00
/workflow-specification/{spec_id}:
2020-01-23 16:05:09 -05:00
parameters :
- name : spec_id
in : path
2021-04-02 17:10:05 -04:00
required : true
2021-04-29 14:29:21 -04:00
description : The unique id of an existing workflow specification.
2020-01-23 16:05:09 -05:00
schema :
type : string
2020-01-28 10:14:06 -05:00
get :
operationId : crc.api.workflow.get_workflow_specification
summary : Returns a single workflow specification
tags :
2020-01-30 09:11:17 -05:00
- Workflow Specifications
2020-01-28 10:14:06 -05:00
responses :
'200' :
description : Workflow specification.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
2021-04-26 08:27:24 -04:00
post :
operationId : crc.api.workflow.get_workflow_from_spec
summary : Creates a workflow from a workflow spec and returns the workflow
tags :
- Workflow Specifications
responses :
'200' :
description : Workflow generated successfully
content :
application/json :
schema :
$ref : "#/components/schemas/Workflow"
2020-01-14 14:10:53 -05:00
put :
2020-01-14 15:39:54 -05:00
operationId : crc.api.workflow.update_workflow_specification
2020-05-31 16:49:39 -04:00
security :
2020-06-11 11:29:58 -04:00
- auth_admin : [ 'secret' ]
2020-01-14 14:10:53 -05:00
summary : Modifies an existing workflow specification with the given parameters.
tags :
2020-01-30 09:11:17 -05:00
- Workflow Specifications
2020-01-14 14:10:53 -05:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpec'
responses :
'200' :
description : Workflow specification created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpec"
2020-01-23 16:05:09 -05:00
delete :
operationId : crc.api.workflow.delete_workflow_specification
2020-05-31 16:49:39 -04:00
security :
2020-06-11 11:29:58 -04:00
- auth_admin : [ 'secret' ]
2020-01-23 16:05:09 -05:00
summary : Removes an existing workflow specification
tags :
2020-01-30 09:11:17 -05:00
- Workflow Specifications
2020-01-23 16:05:09 -05:00
responses :
'204' :
description : The workflow specification has been removed.
2021-08-27 11:40:38 -04:00
/workflow-specification/{spec_id}/reorder:
parameters :
- name : spec_id
in : path
required : true
description : The unique id of an existing workflow specification to validate.
schema :
type : string
- name : direction
in : query
required : true
description : The direction we want to move the spec - `up` or `down`
schema :
type : string
example : up
put :
operationId : crc.api.workflow.reorder_workflow_specification
summary : Move the workflow spec up or down in the display order
tags :
- Workflow Specifications
responses :
'200' :
description : An array of workflow specifications
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/WorkflowSpec"
2020-03-27 08:29:31 -04:00
/workflow-specification/{spec_id}/validate:
parameters :
- name : spec_id
in : path
2021-04-02 17:10:05 -04:00
required : true
2020-03-27 08:29:31 -04:00
description : The unique id of an existing workflow specification to validate.
schema :
type : string
2021-07-07 00:53:30 -04:00
- name : study_id
2021-06-03 14:17:12 -04:00
in : query
required : false
description : Optional id of study to test under different scenarios
schema :
type : string
2021-06-09 14:32:01 -04:00
- name : test_until
in : query
required : false
2021-07-20 11:44:11 -04:00
description : Optional name of task to stop validating at
2021-06-09 14:32:01 -04:00
schema :
type : string
2020-03-27 08:29:31 -04:00
get :
operationId : crc.api.workflow.validate_workflow_specification
summary : Loads and attempts to execute a Workflow Specification, returning a list of errors encountered
tags :
- Workflow Specifications
responses :
'200' :
description : Workflow specification.
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/Error"
2022-01-28 06:42:37 -05:00
/workflow-specification/{spec_id}/file:
parameters :
- name : spec_id
in : path
required : true
description : The unique id of an existing workflow specification to validate.
schema :
type : string
get :
operationId : crc.api.spec_file.get_files
summary : Provide a list of workflow spec files for the given workflow_spec_id. IMPORTANT, only includes metadata, not the file content.
tags :
- Spec Files
responses :
'200' :
description : An array of file descriptions (not the file content)
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/File"
post :
operationId : crc.api.spec_file.add_file
summary : Add a new workflow spec file
tags :
- Spec Files
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
responses :
'200' :
description : Metadata about the uploaded file, but not the file content.
content :
application/json :
schema :
$ref : "#components/schemas/File"
2022-02-02 12:59:56 -05:00
/workflow-specification/{spec_id}/file/{file_name}:
2022-01-28 06:42:37 -05:00
parameters :
- name : spec_id
in : path
required : true
description : The unique id of an existing workflow specification to validate.
schema :
type : string
2022-02-02 12:59:56 -05:00
- name : file_name
2022-01-28 06:42:37 -05:00
in : path
required : true
description : The id of the spec file
schema :
2022-02-02 12:59:56 -05:00
type : string
2022-01-28 06:42:37 -05:00
get :
operationId : crc.api.spec_file.get_file
summary : Returns metadata about the file
tags :
- Spec Files
responses :
'200' :
description : Returns the file information requested.
content :
application/json :
schema :
$ref : "#components/schemas/File"
2022-02-02 12:59:56 -05:00
put :
operationId : crc.api.spec_file.update
summary : updates the given file to be the primary file and process, if so specified.
tags :
- Spec Files
parameters :
- name : is_primary
in : query
required : true
description : Whether to make this the primary file for the workflow.
schema :
type : boolean
requestBody :
description : Log Pagination Request
required : false
content :
application/json :
schema :
$ref : '#/components/schemas/File'
responses :
'200' :
description : Returns the file information.
content :
application/json :
schema :
$ref : "#components/schemas/File"
2022-01-28 06:42:37 -05:00
delete :
operationId : crc.api.spec_file.delete
summary : Removes an existing workflow spec file.
tags :
- Spec Files
responses :
'204' :
description : The file was removed.
2022-02-02 12:59:56 -05:00
/workflow-specification/{spec_id}/file/{file_name}/data:
2022-01-28 06:42:37 -05:00
parameters :
- name : spec_id
in : path
required : true
description : The unique id of an existing workflow specification to validate.
schema :
type : string
2022-02-02 12:59:56 -05:00
- name : file_name
2022-01-28 06:42:37 -05:00
in : path
required : true
description : The id of the requested file
schema :
2022-02-02 12:59:56 -05:00
type : string
2022-01-28 06:42:37 -05:00
get :
operationId : crc.api.spec_file.get_data
summary : Returns only the spec file content
tags :
- Spec Files
responses :
'200' :
description : Returns the actual spec file
content :
application/octet-stream :
schema :
type : string
format : binary
put :
operationId : crc.api.spec_file.update_data
summary : Update the contents of a spec file
tags :
- Spec Files
requestBody :
content :
multipart/form-data :
schema :
x-body-name : file
type : object
properties :
file :
type : string
format : binary
required :
- file
responses :
'200' :
description : Returns the updated file model
content :
application/json :
schema :
$ref : "#/components/schemas/File"
2020-03-16 16:30:56 -04:00
/workflow-specification-category :
get :
operationId : crc.api.workflow.list_workflow_spec_categories
summary : Provides a list of categories that can be added to a workflow spec.
tags :
2020-03-27 08:29:31 -04:00
- Workflow Specification Category
2020-03-16 16:30:56 -04:00
responses :
'200' :
description : An array of workflow specification categories
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/WorkflowSpecCategory"
post :
operationId : crc.api.workflow.add_workflow_spec_category
2020-05-31 16:49:39 -04:00
security :
2020-06-11 11:29:58 -04:00
- auth_admin : [ 'secret' ]
2020-03-16 16:30:56 -04:00
summary : Creates a new workflow spec category with the given parameters.
tags :
2020-03-27 08:29:31 -04:00
- Workflow Specification Category
2020-03-16 16:30:56 -04:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpecCategory'
responses :
'200' :
description : Workflow spec category created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpecCategory"
/workflow-specification-category/{cat_id}:
parameters :
- name : cat_id
in : path
2021-04-02 17:10:05 -04:00
required : true
2020-03-16 16:30:56 -04:00
description : The unique id of an existing workflow spec category to modify.
schema :
2022-02-08 11:30:13 -05:00
type : string
2020-03-16 16:30:56 -04:00
get :
operationId : crc.api.workflow.get_workflow_spec_category
summary : Returns a single workflow spec category
tags :
2020-03-27 08:29:31 -04:00
- Workflow Specification Category
2020-03-16 16:30:56 -04:00
responses :
'200' :
description : Workflow spec category.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpecCategory"
put :
operationId : crc.api.workflow.update_workflow_spec_category
2020-05-31 16:49:39 -04:00
security :
2020-06-11 11:29:58 -04:00
- auth_admin : [ 'secret' ]
2020-03-16 16:30:56 -04:00
summary : Modifies an existing workflow spec category with the given parameters.
tags :
2020-03-27 08:29:31 -04:00
- Workflow Specification Category
2020-03-16 16:30:56 -04:00
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/WorkflowSpecCategory'
responses :
'200' :
description : Workflow spec category created successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/WorkflowSpecCategory"
delete :
operationId : crc.api.workflow.delete_workflow_spec_category
2020-05-31 16:49:39 -04:00
security :
2020-06-11 11:29:58 -04:00
- auth_admin : [ 'secret' ]
2020-03-16 16:30:56 -04:00
summary : Removes an existing workflow spec category
tags :
2020-03-27 08:29:31 -04:00
- Workflow Specification Category
2020-03-16 16:30:56 -04:00
responses :
'204' :
description : The workflow spec category has been removed.
2021-08-27 11:40:38 -04:00
/workflow-specification-category/{cat_id}/reorder:
parameters :
- name : cat_id
in : path
required : true
description : The unique id of an existing workflow spec category to modify.
schema :
type : string
- name : direction
in : query
required : true
description : The direction you want to move the category - `up` or `down`
schema :
type : string
example : up
put :
operationId : crc.api.workflow.reorder_workflow_spec_category
summary : Move the workflow spec category up or down in the display order
tags :
- Workflow Specification Category
responses :
'200' :
description : An array of workflow spec categories
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/WorkflowSpecCategory"
2022-01-11 15:30:22 -05:00
2019-12-27 13:50:03 -05:00
/file :
parameters :
2020-02-04 14:26:53 -05:00
- name : workflow_id
in : query
required : false
description : The unique id of a workflow instance
schema :
type : integer
2021-08-26 10:37:05 -04:00
- name : task_spec_name
in : query
required : false
description : The name of the task spec
schema :
type : string
2020-02-05 15:06:19 -05:00
- name : form_field_key
in : query
required : false
2020-03-19 17:13:30 -04:00
description : The unique key of a workflow task form field. Make sure this matches a document in the irb_documents.xslx reference sheet.
2020-02-05 15:06:19 -05:00
schema :
type : string
2021-04-12 12:23:33 -04:00
- name : study_id
in : query
required : false
description : The study that the files are related to
schema :
type : integer
2019-12-27 13:50:03 -05:00
get :
2020-01-14 15:39:54 -05:00
operationId : crc.api.file.get_files
2019-12-27 13:50:03 -05:00
summary : Provides a list of files that match the given parameters (such as a spec id) IMPORTANT, only includes metadata, not the file content.
tags :
- Files
responses :
'200' :
description : An array of file descriptions (not the file content)
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/File"
2020-03-09 15:12:40 -04:00
2019-12-27 13:50:03 -05:00
post :
2020-01-14 15:39:54 -05:00
operationId : crc.api.file.add_file
2019-12-27 13:50:03 -05:00
summary : Add a new file
tags :
- Files
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
responses :
'200' :
description : Metadata about the uploaded file, but not the file content.
content :
application/json :
schema :
$ref : "#/components/schemas/File"
/file/{file_id}:
parameters :
- name : file_id
in : path
required : true
description : The id of the File requested
schema :
type : integer
get :
2020-01-14 15:39:54 -05:00
operationId : crc.api.file.get_file_info
2019-12-27 13:50:03 -05:00
summary : Returns metadata about a file.
tags :
- Files
responses :
'200' :
description : Returns the file information requested.
content :
application/json :
schema :
$ref : "#/components/schemas/File"
put :
2020-01-31 10:39:19 -05:00
operationId : crc.api.file.update_file_info
2020-01-31 11:33:31 -05:00
summary : Updates existing file info with the given parameters.
2019-12-27 13:50:03 -05:00
tags :
- Files
requestBody :
content :
2020-01-31 10:39:19 -05:00
application/json :
2019-12-27 13:50:03 -05:00
schema :
2020-01-31 11:33:31 -05:00
$ref : '#/components/schemas/File'
2019-12-27 13:50:03 -05:00
responses :
'200' :
2020-01-31 11:33:31 -05:00
description : File info updated successfully.
2019-12-27 13:50:03 -05:00
content :
application/json :
schema :
$ref : "#/components/schemas/File"
delete :
2020-01-14 15:39:54 -05:00
operationId : crc.api.file.delete_file
2022-02-02 12:59:56 -05:00
summary : Removes an existing file.
2019-12-27 13:50:03 -05:00
tags :
- Files
responses :
'204' :
description : The file has been removed.
2021-05-05 11:30:08 -04:00
/file/{file_id}/download :
parameters :
- name : file_id
in : path
required : true
description : The id of the File requested
schema :
type : integer
- name : auth_token
in : query
required : true
description : User Auth Toeken
schema :
type : string
- name : version
in : query
required : false
description : The version of the file, or none for latest version
schema :
type : integer
get :
operationId : crc.api.file.get_file_data_link
summary : Returns only the file contents
security : [ ]
tags :
- Files
responses :
'200' :
description : Returns the actual file
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
2020-05-23 15:37:03 -06:00
/file/{file_id}/data:
2019-12-27 13:50:03 -05:00
parameters :
- name : file_id
in : path
required : true
description : The id of the File requested
schema :
type : integer
2020-05-23 15:21:30 -04:00
- name : version
2020-05-23 15:37:03 -06:00
in : query
2020-05-23 15:21:30 -04:00
required : false
description : The version of the file, or none for latest version
schema :
type : integer
2019-12-27 13:50:03 -05:00
get :
2020-01-31 10:39:19 -05:00
operationId : crc.api.file.get_file_data
2019-12-27 13:50:03 -05:00
summary : Returns only the file contents
tags :
- Files
responses :
'200' :
description : Returns the actual file
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
2020-01-31 10:39:19 -05:00
put :
operationId : crc.api.file.update_file_data
summary : Update only the file contents for a given file
tags :
- Files
requestBody :
content :
multipart/form-data :
schema :
2020-03-16 13:24:15 -04:00
x-body-name : file
2020-01-31 10:39:19 -05:00
type : object
properties :
file :
type : string
format : binary
2020-03-16 13:24:15 -04:00
required :
- file
2020-01-31 10:39:19 -05:00
responses :
'200' :
2020-03-25 08:06:58 -04:00
description : Returns the updated file model with the new version information.
2020-01-31 10:39:19 -05:00
content :
2020-03-25 08:06:58 -04:00
application/json :
2020-01-31 10:39:19 -05:00
schema :
2020-03-25 08:06:58 -04:00
$ref : "#/components/schemas/File"
2022-01-11 15:30:22 -05:00
2020-03-13 15:03:57 -04:00
/reference_file :
get :
2022-01-20 15:22:47 -05:00
operationId : crc.api.reference_file.get_reference_files
2020-03-13 15:03:57 -04:00
summary : Provides a list of existing reference files that are available in the system.
tags :
2022-01-20 15:58:31 -05:00
- Reference Files
2020-03-13 15:03:57 -04:00
responses :
'200' :
description : An array of file descriptions (not the file content)
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/File"
2021-10-12 14:29:15 -04:00
post :
2022-01-20 15:22:47 -05:00
operationId : crc.api.reference_file.add_reference_file
2022-01-20 15:43:32 -05:00
security :
- auth_admin : [ 'secret' ]
2021-10-12 14:29:15 -04:00
summary : Add a new reference file.
tags :
2022-01-20 15:58:31 -05:00
- Reference Files
2021-10-12 14:29:15 -04:00
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
responses :
'200' :
description : Metadata about the new reference file, but not the file content.
content :
application/json :
schema :
$ref : "#/components/schemas/File"
2020-03-13 15:03:57 -04:00
/reference_file/{name}:
parameters :
- name : name
in : path
required : true
description : The special name of the reference file.
schema :
type : string
get :
2022-01-20 15:22:47 -05:00
operationId : crc.api.reference_file.get_reference_file_info
2022-01-19 13:47:14 -05:00
summary : Returns the file info for a reference file
2020-03-13 15:03:57 -04:00
tags :
2022-01-20 15:58:31 -05:00
- Reference Files
2020-03-13 15:03:57 -04:00
responses :
'200' :
2022-01-19 13:47:14 -05:00
description : Returns the info for a reference file
2020-03-13 15:03:57 -04:00
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
2022-01-11 15:30:22 -05:00
delete :
2022-01-20 15:22:47 -05:00
operationId : crc.api.reference_file.delete_reference_file
2022-01-11 15:30:22 -05:00
summary : Remove an existing reference file.
tags :
2022-01-20 15:58:31 -05:00
- Reference Files
2022-01-11 15:30:22 -05:00
responses :
'204' :
description : The reference file was removed.
2022-01-19 13:47:14 -05:00
/reference_file/{name}/data:
parameters :
- name : name
in : path
required : true
description : The special name of the reference file.
schema :
type : string
get :
2022-01-20 15:22:47 -05:00
operationId : crc.api.reference_file.get_reference_file_data
2022-01-19 13:47:14 -05:00
summary : Returns only the reference file content
tags :
2022-01-20 15:58:31 -05:00
- Reference Files
2022-01-19 13:47:14 -05:00
responses :
'200' :
description : Returns the actual reference file
content :
application/octet-stream :
schema :
type : string
format : binary
put :
2022-01-20 15:22:47 -05:00
operationId : crc.api.reference_file.update_reference_file_data
2022-01-20 15:43:32 -05:00
security :
- auth_admin : [ 'secret' ]
2022-01-19 13:47:14 -05:00
summary : Update the contents of a reference file
tags :
2022-01-20 15:58:31 -05:00
- Reference Files
2022-01-19 13:47:14 -05:00
requestBody :
content :
multipart/form-data :
schema :
x-body-name : file
type : object
properties :
file :
type : string
format : binary
required :
- file
responses :
'200' :
description : Returns the updated file model
content :
application/json :
schema :
$ref : "#/components/schemas/File"
2021-08-11 08:55:10 -04:00
/dmn_from_ss :
post :
operationId : crc.api.file.dmn_from_ss
summary : Create a DMN table from a spreadsheet
tags :
- Files
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
responses :
'200' :
description : DMN file for workflow spec
content :
2021-09-03 10:33:12 -04:00
application/octet-stream :
2021-08-11 08:55:10 -04:00
schema :
2021-09-03 10:33:12 -04:00
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
2020-07-14 22:16:44 -04:00
/task_events :
parameters :
- name : action
in : query
required : false
description : The type of action the event documents, options include "ASSIGNMENT" for tasks that are waiting on you, "COMPLETE" for things have completed.
schema :
type : string
2020-07-28 10:16:48 -04:00
- name : workflow
in : query
required : false
description : Restrict results to the given workflow.
schema :
type : number
- name : study
in : query
required : false
description : Restrict results to the given study.
schema :
type : number
2020-07-14 22:16:44 -04:00
get :
operationId : crc.api.workflow.get_task_events
summary : Returns a list of task events related to the current user. Can be filtered by type.
tags :
- Workflows and Tasks
responses :
'200' :
description : Returns details about tasks that are waiting on the current user.
content :
application/json :
schema :
$ref : "#/components/schemas/TaskEvent"
2020-03-13 15:03:57 -04:00
# /v1.0/workflow/0
2019-12-11 16:54:24 -05:00
/workflow/{workflow_id}:
2019-12-30 13:15:39 -05:00
parameters :
2019-11-19 15:57:46 -05:00
- name : workflow_id
in : path
required : true
2019-12-11 16:54:24 -05:00
description : The id of the workflow
2019-11-19 15:57:46 -05:00
schema :
type : integer
format : int32
2019-12-30 13:15:39 -05:00
get :
2020-01-14 15:39:54 -05:00
operationId : crc.api.workflow.get_workflow
2021-01-19 15:00:39 -05:00
summary : Returns a workflow.
2020-03-05 16:45:44 -05:00
parameters :
2020-07-28 13:51:29 -04:00
- name : do_engine_steps
2020-07-28 13:33:38 -04:00
in : query
required : false
2020-07-28 13:51:29 -04:00
description : Defaults to true, can be set to false if you are just looking at the workflow not completeing it.
2020-07-28 13:33:38 -04:00
schema :
type : boolean
2019-12-30 13:15:39 -05:00
tags :
- Workflows and Tasks
2019-11-19 15:57:46 -05:00
responses :
'200' :
2019-12-11 16:54:24 -05:00
description : Returns details about the workflows state and current task
2019-11-19 15:57:46 -05:00
content :
application/json :
schema :
2019-12-11 16:54:24 -05:00
$ref : "#/components/schemas/Workflow"
2019-12-30 13:15:39 -05:00
delete :
2020-04-29 16:07:39 -04:00
operationId : crc.api.workflow.delete_workflow
2020-05-31 16:49:39 -04:00
security :
2020-06-11 11:29:58 -04:00
- auth_admin : [ 'secret' ]
2019-12-30 13:15:39 -05:00
summary : Removes an existing workflow
tags :
2019-12-30 13:34:18 -05:00
- Workflows and Tasks
2019-12-30 13:15:39 -05:00
responses :
'204' :
description : The workflow was removed
2021-01-19 15:00:39 -05:00
/workflow/{workflow_id}/restart:
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
get :
operationId : crc.api.workflow.restart_workflow
summary : Restarts a workflow with the latest spec. Can also clear data.
parameters :
- name : clear_data
in : query
required : false
description : Set this to true to clear data when starting workflow.
schema :
type : boolean
2021-04-15 11:21:51 -04:00
- name : delete_files
in : query
required : false
description : Set this to true to delete associated files when starting workflow.
schema :
2021-01-19 15:00:39 -05:00
type : boolean
tags :
- Workflows and Tasks
responses :
'200' :
description : Returns updated workflow, possibly without data.
content :
application/json :
schema :
$ref : "#/components/schemas/Workflow"
2020-04-22 19:40:40 -04:00
/workflow/{workflow_id}/task/{task_id}/data:
2020-01-07 13:23:46 -05:00
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
2020-01-14 11:02:44 -05:00
- name : task_id
2020-01-07 13:23:46 -05:00
in : path
required : true
description : The id of the task
schema :
type : string
2020-01-14 11:02:44 -05:00
format : uuid
2020-06-17 11:35:06 -04:00
- name : terminate_loop
in : query
required : false
description : Terminate the loop on a looping task
schema :
type : boolean
2021-03-12 20:41:07 -05:00
- name : update_all
in : query
required : false
description : In the case of a multi-instance user task, update all tasks with the submitted values.
schema :
type : boolean
2020-04-22 19:40:40 -04:00
put :
operationId : crc.api.workflow.update_task
summary : Exclusively for User Tasks, submits form data as a flat set of key/values.
2019-11-19 15:57:46 -05:00
tags :
2019-12-11 16:54:24 -05:00
- Workflows and Tasks
2020-04-22 19:40:40 -04:00
requestBody :
description : Key / Value pairs in JSON format.
required : true
content :
application/json :
schema :
type : object
example :
favorite_color : blue
capital_assyria : Assur
2019-11-19 15:57:46 -05:00
responses :
2020-04-22 19:40:40 -04:00
'201' :
2020-04-28 17:25:53 -04:00
description : Returns the updated workflow with this task as the current task.
content :
application/json :
schema :
$ref : "#/components/schemas/Workflow"
/workflow/{workflow_id}/task/{task_id}/set_token:
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
- name : task_id
in : path
required : true
description : The id of the task
schema :
type : string
format : uuid
put :
operationId : crc.api.workflow.set_current_task
summary : Attempts to make the given task the Current Active Task
tags :
- Workflows and Tasks
responses :
'201' :
description : Returns the updated workflow with this task as the current task.
2019-11-19 15:57:46 -05:00
content :
application/json :
schema :
2020-04-22 19:40:40 -04:00
$ref : "#/components/schemas/Workflow"
2021-03-01 14:54:04 -05:00
/workflow/{workflow_id}/lookup/{task_spec_name}/{field_id}:
2020-01-14 11:02:44 -05:00
parameters :
- name : workflow_id
in : path
required : true
description : The id of the workflow
schema :
type : integer
format : int32
2021-03-01 14:54:04 -05:00
- name : task_spec_name
in : path
required : true
description : The name of the current task
schema :
type : string
2020-04-22 19:40:40 -04:00
- name : field_id
in : path
required : true
description : The id of the field (as set in the bpmn editor) on which to do a lookup.
schema :
type : string
- name : query
in : query
required : false
description : The string to search for in the Value column of the lookup table.
schema :
type : string
2020-06-30 10:34:16 -04:00
- name : value
2020-04-22 19:40:40 -04:00
in : query
required : false
2020-06-30 10:34:16 -04:00
description : An alternative to query, this accepts the specific value or id selected in a dropdown list or auto-complete, and will return the one matching record. Useful for getting additional details about an item selected in a dropdown.
2020-04-22 19:40:40 -04:00
schema :
2020-06-30 10:34:16 -04:00
type : string
- name : limit
2020-06-30 10:00:22 -04:00
in : query
required : false
2020-06-30 10:34:16 -04:00
description : The total number of records to return, defaults to 10.
2020-06-30 10:00:22 -04:00
schema :
2020-06-30 10:34:16 -04:00
type : integer
2020-06-30 10:00:22 -04:00
2020-04-22 19:40:40 -04:00
get :
operationId : crc.api.workflow.lookup
summary : Provides type-ahead search against a lookup table associted with a form field.
2019-11-19 15:57:46 -05:00
tags :
2019-12-11 16:54:24 -05:00
- Workflows and Tasks
2019-11-19 15:57:46 -05:00
responses :
'201' :
2020-04-22 19:40:40 -04:00
description : Returns the a list of values and labels for a lookup form.
2019-11-19 15:57:46 -05:00
content :
application/json :
schema :
2020-04-22 19:40:40 -04:00
$ref : "#/components/schemas/LookupItem"
2020-02-29 17:22:38 -05:00
/render_markdown :
parameters :
- name : data
in : query
required : true
description : The json data to use in populating the template
schema :
type : string
- name : template
in : query
required : true
description : The markdown template to process.
schema :
type : string
get :
operationId : crc.api.tools.render_markdown
2020-03-24 14:15:21 -04:00
security : [ ] # Disable security for this endpoint only.
2020-02-29 17:22:38 -05:00
summary : Processes the markdown template using the data provided.
tags :
- Configurator Tools
responses :
'201' :
description : Returns the updated workflow with the task completed.
content :
text/plain :
schema :
type : string
2020-06-08 14:15:56 -04:00
/send_email :
parameters :
2021-03-11 11:10:10 -05:00
- in : query
name : subject
required : true
description : The subject of the email.
schema :
type : string
- in : query
name : address
2020-06-08 14:15:56 -04:00
required : true
description : The address to send a test email to.
schema :
type : string
2021-03-11 11:10:10 -05:00
- in : query
name : data
required : false
description :
The data to use in populating the message.
schema :
type : string
example : {"id_1": "value_1", "id_2": "value_2" }
put :
2020-06-08 14:15:56 -04:00
operationId : crc.api.tools.send_email
2021-03-11 11:10:10 -05:00
summary : Sends an email so we can see what the message will look like.
2020-06-08 14:15:56 -04:00
tags :
- Configurator Tools
2021-03-11 11:10:10 -05:00
requestBody :
required : true
content :
text/plain :
schema :
type : string
2020-06-08 14:15:56 -04:00
responses :
'201' :
description : Returns any error messages that might come back from sending the email.
content :
text/plain :
2020-02-29 17:22:38 -05:00
schema :
type : string
/render_docx :
put :
operationId : crc.api.tools.render_docx
2020-03-24 14:15:21 -04:00
security : [ ] # Disable security for this endpoint only.
2020-02-29 17:22:38 -05:00
summary : Renders a docx template with embedded jinja2 markup.
tags :
- Configurator Tools
requestBody :
content :
multipart/form-data :
schema :
type : object
properties :
file :
type : string
format : binary
2020-05-22 15:30:22 -04:00
data :
type : string
format : json
2020-02-29 17:22:38 -05:00
responses :
'200' :
description : Returns the generated document.
content :
application/octet-stream :
schema :
type : string
format : binary
example : '<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions></bpmn:definitions>'
2020-03-03 15:30:42 -05:00
/list_scripts :
get :
operationId : crc.api.tools.list_scripts
2020-03-24 14:15:21 -04:00
security : [ ] # Disable security for this endpoint only.
2020-03-03 15:30:42 -05:00
summary : Returns an list of scripts, along with their descriptions
tags :
- Configurator Tools
responses :
'201' :
description : The list of scripts
content :
application/json :
schema :
type : array
items :
$ref : "#/components/schemas/Script"
2020-07-21 13:57:33 -04:00
/eval :
2020-07-22 11:30:16 -04:00
put :
2020-07-21 13:57:33 -04:00
operationId : crc.api.tools.evaluate_python_expression
summary : Execute the given python expression, with the given json data structure used as local variables, returns the result of the evaluation.
tags :
- Configurator Tools
2020-07-22 11:30:16 -04:00
requestBody :
2020-08-20 16:13:48 -04:00
description : The expression and the json data to use as local variables when evaluating the expresson.
2020-07-22 11:30:16 -04:00
required : true
content :
application/json :
schema :
type : object
2020-07-21 13:57:33 -04:00
responses :
'200' :
description : Returns the result of executing the given python script.
content :
text/plain :
schema :
type : string
2022-01-11 15:30:22 -05:00
2020-11-13 12:03:29 -05:00
/datastore :
post :
operationId : crc.api.data_store.add_datastore
summary : Add datastore item with the given parameters.
tags :
- DataStore
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/DataStore'
responses :
'200' :
description : Datastore updated successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/DataStore"
/datastore/{id}:
2020-11-11 09:44:58 -05:00
parameters :
2020-11-13 12:03:29 -05:00
- name : id
in : path
2020-11-11 09:44:58 -05:00
required : true
description : The key to lookup.
schema :
type : string
format : string
2020-11-13 12:03:29 -05:00
2020-11-11 09:44:58 -05:00
get :
2020-11-13 12:03:29 -05:00
operationId : crc.api.data_store.datastore_get
summary : Get a datastore item by id
2020-11-11 09:44:58 -05:00
tags :
- DataStore
responses :
'200' :
description : A value from the data store, or a default if provided, or None if not found.
content :
application/json :
schema :
2020-11-13 12:03:29 -05:00
$ref : "#/components/schemas/DataStore"
put :
operationId : crc.api.data_store.update_datastore
summary : Updates an existing datastore item with the given parameters.
tags :
- DataStore
requestBody :
content :
application/json :
schema :
$ref : '#/components/schemas/DataStore'
responses :
'200' :
description : Datastore updated successfully.
content :
application/json :
schema :
$ref : "#/components/schemas/DataStore"
2020-11-13 09:58:21 -05:00
2020-11-13 12:03:29 -05:00
delete :
operationId : crc.api.data_store.datastore_del
summary : Deletes a value from the data store by id
tags :
- DataStore
responses :
'200' :
description : Deletes a value from a data store.
content :
application/json :
schema :
$ref : "#/components/schemas/DataStore"
/datastore/study/{study_id}:
2020-11-13 09:58:21 -05:00
parameters :
- name : study_id
2020-11-13 12:03:29 -05:00
in : path
2020-11-13 09:58:21 -05:00
required : true
description : The study id we are concerned with .
schema :
type : integer
format : int32
get :
operationId : crc.api.data_store.study_multi_get
2020-11-13 12:03:29 -05:00
summary : Gets all datastore items for a study_id
2020-11-13 09:58:21 -05:00
tags :
- DataStore
responses :
'200' :
description : Get all values from the data store for a study_id
content :
application/json :
schema :
2020-11-13 12:03:29 -05:00
$ref : "#/components/schemas/DataStore"
/datastore/user/{user_id}:
parameters :
- name : user_id
in : path
required : true
description : The user id we are concerned with .
schema :
type : string
format : string
get :
operationId : crc.api.data_store.user_multi_get
summary : Gets all datastore items by user_id
tags :
- DataStore
responses :
'200' :
description : Get all values from the data store for a user_id.
content :
application/json :
schema :
$ref : "#/components/schemas/DataStore"
2021-06-01 13:49:21 -04:00
/datastore/file/{file_id}:
parameters :
- name : file_id
in : path
required : true
description : The file id we are concerned with
schema :
type : string
format : string
get :
operationId : crc.api.data_store.file_multi_get
summary : Gets all datastore items by file_id
tags :
- DataStore
responses :
'200' :
description : Get all values from the data store for a file_id
content :
application/json :
schema :
$ref : "#/components/schemas/DataStore"
2022-01-11 15:30:22 -05:00
2022-01-28 16:11:36 -05:00
/git_repo :
get :
operationId : crc.api.git_repo.get_repo
summary : get current state of the git repo
tags :
- Git Repo
responses :
'200' :
description : Current state of the git repo
content :
application/json :
schema :
$ref : "#/components/schemas/GitRepo"
2022-02-01 10:49:35 -05:00
/git_repo/merge :
parameters :
- name : branch
in : query
required : true
description : The branch to merge with
schema :
type : string
example : staging
get :
operationId : crc.api.git_repo.merge_with_branch
summary : merge with given branch
tags :
- Git Repo
responses :
'200' :
description : Current state of the git repo
content :
application/json :
schema :
$ref : "#/components/schemas/GitRepo"
/git_repo/push :
parameters :
- name : comment
in : query
required : false
description : The comment we want to pass along with the push commit
schema :
type : string
get :
operationId : crc.api.git_repo.push_to_remote
summary : Push local changes to remote
tags :
- Git Repo
responses :
'200' :
description : Local changes were pushed successfully
/git_repo/pull :
get :
operationId : crc.api.git_repo.pull_from_remote
summary : Pull current code from remote
tags :
- Git Repo
responses :
'200' :
description : Remote code was pulled successfully
2022-01-28 16:11:36 -05:00
2019-11-19 15:57:46 -05:00
components :
2020-03-24 14:15:21 -04:00
securitySchemes :
jwt :
type : http
scheme : bearer
bearerFormat : JWT
x-bearerInfoFunc : crc.api.user.verify_token
2020-06-11 11:29:58 -04:00
auth_admin :
2020-05-31 16:49:39 -04:00
type : http
scheme : bearer
bearerFormat : JWT
x-bearerInfoFunc : crc.api.user.verify_token_admin
2020-12-09 12:13:17 -05:00
2019-11-19 15:57:46 -05:00
schemas :
2020-02-18 16:38:56 -05:00
User :
properties :
uid :
type : string
email_address :
type : string
display_name :
type : string
2020-02-20 15:35:07 -05:00
affiliation :
type : string
eppn :
type : string
first_name :
type : string
last_name :
type : string
title :
type : string
2019-12-31 16:32:47 -05:00
DataModel :
properties :
id :
type : string
2020-12-09 12:13:17 -05:00
WorkflowSpecDiffList :
properties :
2020-12-11 08:29:37 -05:00
workflow_spec_id :
2020-12-09 12:13:17 -05:00
type : string
example : top_level_workflow
date_created :
type : string
example : 2020-12-09 16:55:12.951500 +00 : 00
location :
type : string
example : remote
new :
type : boolean
example : false
WorkflowSpecFilesList :
properties :
file_model_id :
type : integer
example : 171
2020-12-11 08:29:37 -05:00
workflow_spec_id :
2020-12-09 12:13:17 -05:00
type : string
example : top_level_workflow
filename :
type : string
example : data_security_plan.dmn
date_created :
type : string
example : 2020-12-01 13:58:12.420333 +00 : 00
type :
type : string
example : dmn
primary :
type : boolean
example : false
content_type :
type : string
example : text/xml
primary_process_id :
type : string
example : null
md5_hash :
type : string
example : f12e2bbd-a20c-673b-ccb8-a8a1ea9c5b7b
WorkflowSpecFilesDiff :
properties :
filename :
type : string
example : data_security_plan.dmn
date_created :
type : string
example : 2020-12-01 13:58:12.420333 +00 : 00
type :
type : string
example : dmn
primary :
type : boolean
example : false
content_type :
type : string
example : text/xml
primary_process_id :
type : string
example : null
md5_hash :
type : string
example : f12e2bbd-a20c-673b-ccb8-a8a1ea9c5b7b
location :
type : string
example : remote
new :
type : boolean
example : false
WorkflowSpecAll :
properties :
2020-12-11 08:29:37 -05:00
workflow_spec_id :
2020-12-09 12:13:17 -05:00
type : string
example : acaf1258-43b4-437e-8846-f612afa66811
date_created :
type : string
example : 2020-12-01 13:58:12.420333 +00 : 00
md5_hash :
type : string
example : c30fd597f21715018eab12f97f9d4956
2019-12-11 16:54:24 -05:00
Study :
properties :
id :
2019-12-19 11:58:51 -05:00
type : integer
example : 1234
2021-03-22 17:30:49 -04:00
title :
type : string
example : The impact of fried pickles on beer consumption in bipedal software developers.
last_updated :
type : string
format : date_time
example : "2019-12-25T09:12:33.001Z"
primary_investigator_id :
type : string
x-nullable : true
example : dhf8r
user_uid :
type : string
example : dhf8r
status :
type : string
enum : [ 'in_progress' , 'hold' , 'open_for_enrollment' , 'abandoned' ]
example : done
sponsor :
type : string
x-nullable : true
example : "Sartography Pharmaceuticals"
ind_number :
type : string
x-nullable : true
example : "27b-6-42"
StudyAssociate :
properties :
2021-07-22 14:36:00 -04:00
uid :
2019-12-11 16:54:24 -05:00
type : string
2021-07-22 14:36:00 -04:00
example : "dhf8r"
access :
type : boolean
example : False
role :
2020-03-30 10:12:10 -04:00
type : string
2021-07-22 14:36:00 -04:00
example : "TODO"
2021-04-21 14:00:19 -04:00
DocumentDirectory :
2021-04-20 08:12:27 -04:00
properties :
2021-04-21 14:00:19 -04:00
level :
2021-04-20 08:12:27 -04:00
type : string
x-nullable : true
example : "Ancillary Document"
description :
type : string
x-nullable : true
2021-04-21 14:00:19 -04:00
example : "Documents that are ancillary to the study"
file :
$ref : "#/components/schemas/File"
x-nullable : true
expanded :
type : boolean
example : False
filecount :
type : integer
example : 1
children :
type : array
items :
$ref : "#/components/schemas/File"
2020-11-13 12:03:29 -05:00
DataStore :
properties :
id :
type : integer
example : 1234
key :
type : string
example : MyKey
workflow_id :
type : integer
x-nullable : true
example : 12
study_id :
type : integer
x-nullable : true
example : 42
user_id :
type : string
x-nullable : true
example : dhf8r
task_id :
type : string
x-nullable : true
example : MyTask
spec_id :
type : string
x-nullable : true
example : My Spec Name
value :
type : string
x-nullable : true
example : Some Value
2019-12-18 14:02:17 -05:00
WorkflowSpec :
2019-12-11 16:54:24 -05:00
properties :
id :
type : string
2020-03-16 12:10:32 -04:00
name :
type : string
2019-12-18 14:02:17 -05:00
display_name :
2019-12-11 16:54:24 -05:00
type : string
2019-12-18 14:02:17 -05:00
description :
2019-12-11 16:54:24 -05:00
type : string
2020-03-16 12:10:32 -04:00
primary_process_id :
type : string
nullable : true
Created a "StudyService" and moved all complex logic around study manipulation out of the study api, and this service, as things were getting complicated. The Workflow Processor no longer creates the WorkflowModel, the study object handles that, and only passes the model into the workflow processor when it is ready to start the workflow.
Created a Study object (seperate from the StudyModel) that can cronstructed on request, and contains a different data structure than we store in the DB. This allows us to return underlying Categories and Workflows in a clean way.
Added a new status to workflows called "not_started", meaning we have not yet instantiated a processor or created a BPMN, they have no version yet and no stored data, just the possiblity of being started.
The Top Level Workflow or "Master" workflow is now a part of the sample data, and loaded at all times.
Removed the ability to "add a workflow to a study" and "remove a workflow from a study", a study contains all possible workflows by definition.
Example data no longer creates users or studies, it just creates the specs.
2020-03-30 08:00:16 -04:00
category_id :
2022-02-08 11:30:13 -05:00
type : string
2020-03-16 12:10:32 -04:00
nullable : true
2021-04-26 08:27:24 -04:00
standalone :
type : boolean
example : false
2021-05-06 11:54:04 -04:00
default : false
2020-03-16 12:10:32 -04:00
workflow_spec_category :
$ref : "#/components/schemas/WorkflowSpecCategory"
is_status :
type : boolean
nullable : true
WorkflowSpecCategory :
properties :
id :
2022-02-08 11:30:13 -05:00
type : string
2020-03-16 12:10:32 -04:00
name :
type : string
display_name :
type : string
2020-03-26 15:29:52 -04:00
display_order :
type : integer
2020-03-30 10:12:10 -04:00
workflows :
type : array
items :
$ref : "#/components/schemas/Workflow"
2019-12-27 13:50:03 -05:00
File :
properties :
id :
type : number
name :
type : string
example : "random_fact.bpmn"
version :
2020-01-31 11:33:31 -05:00
type : integer
2019-12-27 13:50:03 -05:00
last_updated :
type : string
format : date_time
example : "2019-12-25T09:12:33.001Z"
type :
2020-01-31 11:33:31 -05:00
type : string
2019-12-27 13:50:03 -05:00
primary :
type : boolean
content_type :
type : string
example : "application/xml"
2020-12-11 08:29:37 -05:00
workflow_spec_id :
2019-12-27 13:50:03 -05:00
type : string
example : "random_fact"
2020-03-20 08:21:21 -04:00
x-nullable : true
2019-12-27 13:50:03 -05:00
file :
2021-07-20 11:44:11 -04:00
type : string
2019-12-11 16:54:24 -05:00
Workflow :
2019-11-19 15:57:46 -05:00
properties :
id :
readOnly : true
type : integer
format : int64
2019-12-18 14:02:17 -05:00
status :
2021-04-02 17:10:05 -04:00
type : string
2020-02-07 11:34:44 -05:00
enum : [ 'new' , 'user_input_required' , 'waiting' , 'complete' ]
2020-05-14 13:43:23 -04:00
navigation :
type : array
items :
$ref : "#/components/schemas/NavigationItem"
2020-03-05 17:10:00 -05:00
next_task :
$ref : "#/components/schemas/Task"
2020-12-11 08:29:37 -05:00
workflow_spec_id :
2020-02-07 12:36:08 -05:00
type : string
2020-03-05 17:10:00 -05:00
spec_version :
type : string
is_latest_spec :
type : boolean
2020-03-10 15:46:14 -04:00
num_tasks_total :
type : integer
num_tasks_complete :
type : integer
num_tasks_incomplete :
type : integer
2021-04-29 14:29:21 -04:00
study_id :
type : integer
2020-02-07 11:34:44 -05:00
2019-11-19 15:57:46 -05:00
example :
2019-12-11 16:54:24 -05:00
id : 291234
2019-12-18 14:02:17 -05:00
status : 'user_input_required'
2020-12-11 08:29:37 -05:00
workflow_spec_id : 'random_fact'
2020-03-05 17:10:00 -05:00
spec_version : 'v1.1 [22,23]'
is_latest_spec : True
next_task :
id : study_identification
name : Study Identification
title : IRB Review
documentation : "# Heading 1\n\nMarkdown documentation text goes here"
type : form
state : ready
2019-12-11 16:54:24 -05:00
Task :
2019-11-19 15:57:46 -05:00
properties :
id :
readOnly : true
2019-12-20 14:32:04 -05:00
type : string
2019-11-19 15:57:46 -05:00
name :
type : string
2019-12-20 15:39:02 -05:00
title :
type : string
2019-12-11 16:54:24 -05:00
type :
2019-11-19 15:57:46 -05:00
type : string
2019-12-20 14:32:04 -05:00
state :
2019-12-19 11:58:51 -05:00
type : string
2019-12-11 16:54:24 -05:00
form :
2019-12-18 14:02:17 -05:00
$ref : "#/components/schemas/Form"
2019-12-20 15:39:02 -05:00
documentation :
type : string
2020-05-15 15:54:53 -04:00
data :
type : object
2020-05-15 16:38:37 -04:00
multi_instance_type :
2021-04-02 17:10:05 -04:00
type : string
2020-05-15 15:54:53 -04:00
enum : [ 'none' , 'looping' , 'parallel' , 'sequential' ]
2020-05-15 16:38:37 -04:00
multi_instance_count :
2020-05-15 15:54:53 -04:00
type : number
2020-05-15 16:38:37 -04:00
multi_instance_index :
2020-05-15 15:54:53 -04:00
type : number
2020-05-15 16:38:37 -04:00
process_name :
2020-05-15 15:54:53 -04:00
type : string
properties :
type : object
2019-11-19 15:57:46 -05:00
example :
2019-12-20 14:32:04 -05:00
id : study_identification
name : Study Identification
2019-12-20 15:39:02 -05:00
title : IRB Review
documentation : "# Heading 1\n\nMarkdown documentation text goes here"
2019-12-20 14:32:04 -05:00
type : form
state : ready
form :
"key": "irb_review_form"
"fields" :
- "id": "irb_review_type"
"type": "enum"
"label": "Select IRB Review Type"
"options" :
- id : "emergency_use"
name : "Emergency Use"
- id : "humanitarian_device"
name : "Humanitarian Device"
- id : "non_human"
name : "Non-Human"
- id : "non_uva_agent"
name : "Non-UVA Agent"
- id : "exempt"
name : "Exempt"
- id : "non_engaged"
name : "Non-Engaged"
- id : "expedited"
name : "Expedited"
- id : "full_board"
name : "Full Board"
2020-02-18 10:14:03 -05:00
"default_value": "Full Board"
2019-12-20 14:32:04 -05:00
"validation" :
- name : "required"
config : "true"
"properties" :
- id : "description"
value : "Description text goes here"
- id : "help"
value : "# Heading 1\n\nMarkdown help text goes here"
- id : "required_expression"
value : "model.my_boolean_field_id && model.my_enum_field_value !== 'something'"
- id : "hide_expression"
value : "model.my_enum_field_value === 'something'"
2022-01-10 13:16:54 -05:00
PaginatedTaskLog :
properties :
code :
example : "email_sent"
type : string
2022-01-12 08:58:50 -05:00
level :
example : "warning"
type : string
user :
example : "email_sent"
type : string
2022-01-10 13:16:54 -05:00
page :
type : integer
example : 0
per_page :
type : integer
example : 10
sort_column :
type : string
example : "timestamp"
sort_reverse :
type : boolean
example : false
items :
type : array
items :
$ref : "#/components/schemas/TaskLog"
2022-01-12 08:58:50 -05:00
has_next :
type : boolean
example : true
2022-03-08 16:52:37 -05:00
has_prev :
2022-01-12 08:58:50 -05:00
type : boolean
example : false
2022-01-10 13:16:54 -05:00
TaskLog :
properties :
level :
type : string
example : "info"
code :
example : "email_sent"
type : string
message :
example : "Approval email set to Jake in Accounting"
type : string
workflow_id :
example : 42
type : integer
study_id :
example : 187
type : integer
user_uid :
example : "dhf8r"
type : string
timestamp :
type : string
format : date_time
example : "2021-01-07T11:36:40.001Z"
2020-07-14 22:16:44 -04:00
TaskEvent :
properties :
workflow :
$ref : "#/components/schemas/Workflow"
study :
$ref : "#/components/schemas/Study"
workflow_sec :
$ref : "#/components/schemas/WorkflowSpec"
spec_version :
type : string
action :
type : string
task_id :
type : string
task_type :
type : string
task_lane :
type : string
form_data :
type : object
mi_type :
type : string
mi_count :
type : integer
mi_index :
type : integer
process_name :
type : string
date :
type : string
2019-12-18 14:02:17 -05:00
Form :
properties :
2019-12-20 14:32:04 -05:00
key :
type : string
2019-12-18 14:02:17 -05:00
fields :
type : array
items :
$ref : "#/components/schemas/Field"
2019-12-20 14:32:04 -05:00
example :
"key": "irb_review_form"
"fields" :
- "id": "irb_review_type"
"type": "enum"
"label": "Select IRB Review Type"
"options" :
- id : "emergency_use"
name : "Emergency Use"
- id : "humanitarian_device"
name : "Humanitarian Device"
- id : "non_human"
name : "Non-Human"
- id : "non_uva_agent"
name : "Non-UVA Agent"
- id : "exempt"
name : "Exempt"
- id : "non_engaged"
name : "Non-Engaged"
- id : "expedited"
name : "Expedited"
- id : "full_board"
name : "Full Board"
2020-02-18 10:14:03 -05:00
"default_value": "Full Board"
2019-12-20 14:32:04 -05:00
"validation" :
- name : "required"
config : "true"
"properties" :
- id : "description"
value : "Description text goes here"
- id : "help"
value : "# Heading 1\n\nMarkdown help text goes here"
- id : "required_expression"
value : "model.my_boolean_field_id && model.my_enum_field_value !== 'something'"
- id : "hide_expression"
value : "model.my_enum_field_value === 'something'"
2019-12-18 14:02:17 -05:00
Field :
properties :
id :
type : string
readOnly : true
type :
2021-04-02 17:10:05 -04:00
type : string
2019-12-20 14:32:04 -05:00
enum : [ 'string' , 'long' , 'boolean' , 'date' , 'enum' ]
readOnly : true
label :
type : string
2019-12-18 14:02:17 -05:00
readOnly : true
options :
type : array
items :
2019-12-20 14:32:04 -05:00
$ref : "#/components/schemas/EnumFieldOption"
2019-12-18 14:02:17 -05:00
readOnly : true
2020-02-18 10:14:03 -05:00
default_value :
2019-12-20 14:32:04 -05:00
type : string
2020-02-18 10:14:03 -05:00
readOnly : true
2019-12-20 14:32:04 -05:00
validation :
type : array
items :
$ref : "#/components/schemas/FieldValidation"
2019-12-18 14:02:17 -05:00
readOnly : true
2019-12-20 14:32:04 -05:00
"properties" :
type : array
items :
$ref : "#/components/schemas/FieldProperty"
readOnly : true
EnumFieldOption :
properties :
id :
type : string
name :
type : string
FieldValidation :
properties :
name :
type : string
config :
type : string
FieldProperty :
properties :
id :
type : string
2019-12-18 14:02:17 -05:00
value :
type : string
2019-12-20 14:32:04 -05:00
example :
id : "required_expression"
value : "model.should_require"
2019-11-19 15:57:46 -05:00
Error :
required :
- code
- message
properties :
code :
2019-12-11 16:54:24 -05:00
type : string
format : string
example : "access_denied"
2019-11-19 15:57:46 -05:00
message :
type : string
2019-12-11 16:54:24 -05:00
example : "You do not have permission to view the requested study."
2020-03-03 15:30:42 -05:00
Script :
properties :
name :
type : string
format : string
example : "random_fact"
description :
type : string
example : "Returns a random fact about a topic. Provide an argument of either 'cat', 'norris', or 'buzzword'"
2020-04-22 19:40:40 -04:00
LookupItem :
properties :
value :
type : string
format : string
example : "1000"
label :
type : string
example : "Chuck Norris"
data :
2021-04-02 17:10:05 -04:00
type : string
2020-05-14 13:43:23 -04:00
NavigationItem :
properties :
id :
type : number
format : integer
example : 5
2020-05-15 15:54:53 -04:00
task_id :
type : string
format : uuid
example : "1234123uuid1234"
2020-05-14 13:43:23 -04:00
name :
type : string
example : "Task_Has_bananas"
description :
type : string
example : "Has Bananas?"
backtracks :
2020-05-15 15:54:53 -04:00
type : boolean
2020-05-14 13:43:23 -04:00
example : false
level :
type : integer
example : 1
indent :
type : integer
example : 2
2020-05-15 16:38:37 -04:00
child_count :
2020-05-14 13:43:23 -04:00
type : integer
example : 4
state :
2021-04-02 17:10:05 -04:00
type : string
2020-05-14 13:43:23 -04:00
enum : [ 'FUTURE' , 'WAITING' , 'READY' , 'CANCELLED' , 'COMPLETED' , 'LIKELY' , 'MAYBE' ]
readOnly : true
2020-05-15 16:38:37 -04:00
is_decision :
2020-05-15 15:54:53 -04:00
type : boolean
example : False
readOnly : true
task :
$ref : "#/components/schemas/Task"
2020-05-22 18:25:00 -04:00
Approval :
properties :
id :
type : number
format : integer
example : 5
2020-06-05 22:19:37 -04:00
ApprovalCounts :
properties :
PENDING :
type : number
format : integer
example : 5
APPROVED :
type : number
format : integer
example : 5
DECLINED :
type : number
format : integer
example : 5
CANCELED :
type : number
format : integer
example : 5
AWAITING :
type : number
format : integer
example : 5
2022-01-28 16:11:36 -05:00
GitRepo :
properties :
2022-02-01 10:49:35 -05:00
# remote:
# type: string
# example: sartography/crconnect-workflow-specs
2022-01-28 16:11:36 -05:00
directory :
type : string
example : /home/cr-connect/sync_files
branch :
type : string
example : dev
2022-02-01 10:49:35 -05:00
merge_branch :
type : string
example : staging
changes :
type : array
2022-02-11 12:45:29 -05:00
example : [ 'file_1.txt' , 'file_2.txt' ]
2022-02-01 10:49:35 -05:00
untracked :
type : array
2022-02-11 12:45:29 -05:00
example : [ 'a_file.txt' , 'b_file.txt' ]