{ "swagger": "2.0", "info": { "description": "Rest API for communication between SciCat frontend and depositor backend. Backend service enables deposition of datasets to OneDep API.", "title": "OpenEm Depositor API", "contact": {}, "version": "api/v1" }, "paths": { "/empiar/metadata": { "post": { "description": "NA", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "empiar" ], "summary": "creates a json file with metadata for deposition to EMPIAR", "parameters": [ { "description": "Scientific metadata as a JSON string; expects elements from OSCEM on the top level", "name": "scientificMetadata", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "json file with metadata", "schema": { "$ref": "#/definitions/empiar.Imageset" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/empiar/schema": { "get": { "description": "NA", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "empiar" ], "summary": "creates a json file with metadata for deposition to EMPIAR", "responses": { "200": { "description": "base64 encoded schema", "schema": { "type": "string" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/onedep": { "post": { "description": "Create a new deposition by uploading experiment and user details to OneDep API.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "onedep" ], "summary": "Create a new deposition to OneDep", "parameters": [ { "description": "User information", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/onedep.RequestCreate" } } ], "responses": { "201": { "description": "Success response with Deposition ID", "schema": { "$ref": "#/definitions/onedep.DepositionResponse" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/onedep/metadata": { "post": { "description": "Downloading a metadata file. Invokes converter and starts download.", "consumes": [ "application/json" ], "produces": [ "application/octet-stream" ], "tags": [ "onedep" ], "summary": "Get a cif file with metadata for manual deposition in OneDep", "parameters": [ { "description": "Scientific metadata as a JSON string; expects elements from OSCEM on the top level", "name": "scientificMetadata", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/onedep/pdb": { "post": { "description": "Downloading a metadata file. Invokes converter and starts download.", "consumes": [ "multipart/form-data" ], "produces": [ "application/octet-stream" ], "tags": [ "onedep" ], "summary": "Get a cif file with metadata and coordinates for manual deposition in OneDep", "parameters": [ { "type": "string", "description": "Scientific metadata as a JSON string; expects elements from OSCEM on the top level", "name": "scientificMetadata", "in": "formData", "required": true }, { "type": "file", "description": "File to upload", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/onedep/{depID}/file": { "post": { "description": "Uploading file, and metadata to OneDep API.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "onedep" ], "summary": "Add file, pixel spacing, contour level and description to deposition in OneDep", "parameters": [ { "type": "string", "description": "Deposition ID to which a file should be uploaded", "name": "depID", "in": "path", "required": true }, { "type": "array", "items": { "type": "file" }, "collectionFormat": "multi", "description": "File to upload", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "File metadata as a JSON string", "name": "fileMetadata", "in": "formData", "required": true }, { "type": "string", "description": "JWT token for OneDep API", "name": "jwtToken", "in": "formData", "required": true } ], "responses": { "200": { "description": "File ID", "schema": { "$ref": "#/definitions/onedep.FileResponse" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/onedep/{depID}/metadata": { "post": { "description": "Uploading metadata file to OneDep API. This is created by parsing the JSON metadata into the converter.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "onedep" ], "summary": "Add a cif file with metadata to deposition in OneDep", "parameters": [ { "type": "string", "description": "Deposition ID to which a file should be uploaded", "name": "depID", "in": "path", "required": true }, { "type": "string", "description": "JWT token for OneDep API", "name": "jwtToken", "in": "formData", "required": true }, { "type": "string", "description": "Scientific metadata as a JSON string; expects elements from OSCEM on the top level", "name": "scientificMetadata", "in": "formData", "required": true } ], "responses": { "200": { "description": "File ID", "schema": { "$ref": "#/definitions/onedep.FileResponse" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/onedep/{depID}/pdb": { "post": { "description": "Uploading file to OneDep API.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "onedep" ], "summary": "Add coordinates and description to deposition in OneDep", "parameters": [ { "type": "string", "description": "Deposition ID to which a file should be uploaded", "name": "depID", "in": "path", "required": true }, { "type": "string", "description": "JWT token for OneDep API", "name": "jwtToken", "in": "formData", "required": true }, { "type": "file", "description": "File to upload", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "Scientific metadata as a JSON string; expects elements from OSCEM on the top level", "name": "scientificMetadata", "in": "formData", "required": true } ], "responses": { "200": { "description": "File ID", "schema": { "$ref": "#/definitions/onedep.FileResponse" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/onedep/{depID}/process": { "post": { "description": "Process a deposition in OneDep API.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "onedep" ], "summary": "Process deposition to OneDep", "parameters": [ { "type": "string", "description": "Deposition ID to which a file should be uploaded", "name": "depID", "in": "path", "required": true }, { "type": "string", "description": "JWT token for OneDep API", "name": "jwtToken", "in": "formData", "required": true } ], "responses": { "200": { "description": "Deposition ID", "schema": { "$ref": "#/definitions/onedep.CreatedDeposition" } }, "400": { "description": "Error response", "schema": { "$ref": "#/definitions/onedep.ResponseType" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/onedep.ResponseType" } } } } }, "/version": { "get": { "description": "Create a new deposition by uploading experiments, files, and metadata to OneDep API.", "produces": [ "application/json" ], "tags": [ "version" ], "summary": "Return current version", "responses": { "200": { "description": "Depositior version", "schema": { "type": "string" } }, "400": { "description": "Error response", "schema": { "type": "string" } } } } } }, "definitions": { "empiar.Imageset": { "type": "object", "properties": { "category": { "type": "string" }, "data_format": { "type": "string" }, "details": { "type": "string" }, "directory": { "type": "string" }, "frames_per_image": { "type": "integer" }, "header_format": { "type": "string" }, "image_height": { "type": "integer" }, "image_width": { "type": "integer" }, "micrographs_file_pattern": { "type": "string" }, "name": { "type": "string" }, "num_images_or_tilt_series": { "type": "integer" }, "picked_particles_directory": { "type": "string" }, "picked_particles_file_pattern": { "type": "string" }, "pixel_height": { "type": "number" }, "pixel_width": { "type": "number" }, "voxel_type": { "type": "string" } } }, "onedep.CreatedDeposition": { "type": "object", "properties": { "depID": { "type": "string" } } }, "onedep.DepositionResponse": { "type": "object", "properties": { "bmrb_id": { "type": "string" }, "code": { "type": "string" }, "created": { "type": "string" }, "email": { "type": "string" }, "emdb_id": { "type": "string" }, "errors": { "$ref": "#/definitions/onedep.OneDepError" }, "experiments": { "description": "FIX ME actual response type does not correspond to the documented." }, "hold_exp_date": { "type": "string" }, "id": { "type": "string" }, "last_login": { "type": "string" }, "message": { "type": "string" }, "pdb_id": { "type": "string" }, "site": { "type": "string" }, "site_url": { "type": "string" }, "status": { "$ref": "#/definitions/onedep.Status" }, "title": { "type": "string" } } }, "onedep.FileResponse": { "type": "object", "properties": { "created": { "type": "string" }, "errors": { "description": "FIX ME actual response type does not correspond to the documented." }, "id": { "type": "integer" }, "metadata": { "description": "not there", "type": "object", "additionalProperties": {} }, "name": { "description": "not there", "type": "string" }, "type": { "$ref": "#/definitions/onedep.OneDepType" }, "warnings": { "description": "FIX ME actual response type does not correspond to the documented." } } }, "onedep.OneDepError": { "type": "object", "properties": { "code": { "type": "string" }, "extras": { "type": "object", "additionalProperties": { "type": "array", "items": {} } }, "message": { "type": "string" } } }, "onedep.OneDepType": { "type": "string", "enum": [ "add-map", "co-cif", "md-cif", "co-pdb", "fsc-xml", "half-map", "img-emdb", "layer-lines", "mask-map", "nm-aux-amb", "nm-aux-gro", "nm-pea-any", "nm-res-amb", "nm-res-bio", "nm-res-cha", "nm-res-cns", "nm-res-cya", "nm-res-dyn", "nm-res-gro", "nm-res-isd", "nm-res-oth", "nm-res-ros", "nm-res-syb", "nm-res-xpl", "nm-shi", "nm-uni-nef", "nm-uni-str", "vo-map", "xa-mat", "xa-par", "xa-top", "xs-cif", "xs-mtz" ], "x-enum-varnames": [ "ADD_MAP", "CO_CIF", "MD_CIF", "CO_PDB", "FSC_XML", "HALF_MAP", "IMG_EMDB", "LAYER_LINES", "MASK_MAP", "NM_AUX_AMB", "NM_AUX_GRO", "NM_PEA_ANY", "NM_RES_AMB", "NM_RES_BIO", "NM_RES_CHA", "NM_RES_CNS", "NM_RES_CYA", "NM_RES_DYN", "NM_RES_GRO", "NM_RES_ISD", "NM_RES_OTH", "NM_RES_ROS", "NM_RES_SYB", "NM_RES_XPL", "NM_SHI", "NM_UNI_NEF", "NM_UNI_STR", "VO_MAP", "XA_MAT", "XA_PAR", "XA_TOP", "XS_CIF", "XS_MTZ" ] }, "onedep.RequestCreate": { "type": "object", "required": [ "country", "email", "jwtToken", "method", "orcidIds" ], "properties": { "coordinates": { "type": "boolean" }, "country": { "type": "string" }, "email": { "type": "string" }, "jwtToken": { "type": "string" }, "method": { "type": "string" }, "orcidIds": { "type": "array", "items": { "type": "string" } }, "password": { "type": "string" } } }, "onedep.ResponseType": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "string" } } }, "onedep.Status": { "type": "string", "enum": [ "auco", "auth", "auxs", "auxu", "dep", "hold", "hpub", "obs", "polc", "proc", "rel", "repl", "reup", "wait", "wdrn" ], "x-enum-varnames": [ "AUCO", "AUTH", "AUXS", "AUXU", "DEP", "HOLD", "HPUB", "OBS", "POLC", "PROC", "REL", "REPL", "REUP", "WAIT", "WDRN" ] } } }