Page tree
Skip to end of metadata
Go to start of metadata
{ "swagger": "2.0", "info": { "description": "The Theme API (beta) gives site admins controls to manage UI themes.", "version": "1.7.4.1", "title": "XNAT Theme API (beta)" }, "tags": [ { "name": "theme-api", "description": "XNAT Theme API (beta)" } ], "definitions": { "ThemeConfig": { "type": "object", "properties": { "enabled": {"type": "boolean"}, "name": {"type": "string"}, "path": {"type": "string"}, "roles": { "type": "array", "items": {"type": "object"} } } }, "TypeOption": { "type": "object", "properties": { "label": {"type": "string"}, "value": {"type": "string"} } } }, "paths": { "/xapi/theme": { "get": { "tags": ["theme-api"], "summary": "Get list of available themes.", "description": "Use this to get a list of all available themes on the XNAT system.", "operationId": "themesGetUsingGET", "consumes": ["application/json"], "produces": ["application/json"], "responses": { "200": { "description": "Reports the currently selected global theme (if there is one), whether or not it's enabled, and a list of available themes on the system in a JSON string.", "schema": { "type": "array", "items": {"$ref": "#/definitions/TypeOption"} } }, "401": {"description": "Unauthorized"}, "500": {"description": "Unexpected error"}, "403": {"description": "Forbidden"}, "404": {"description": "Not Found"} } }, "post": { "tags": ["theme-api"], "summary": "Accepts a multipart form with a zip file upload and extracts its contents in the theme system folder. If successful, the first (root) directory name (or theme name) unzipped is returned in the response. This will overwrite any other directories already existing with the same name without warning.", "description": "The structure of the zipped package must have only directories at it's root.", "operationId": "themePostUploadUsingPOST", "consumes": ["multipart/form-data"], "produces": ["application/json"], "parameters": [{ "name": "themePackage", "in": "formData", "description": "Multipart file object being uploaded", "required": true, "type": "string" }], "responses": { "200": { "description": "Theme package successfully uploaded and extracted.", "schema": {"type": "string"} }, "201": {"description": "Created"}, "401": {"description": "Must be authenticated to access the XNAT REST API."}, "500": {"description": "Unexpected error"}, "403": {"description": "Not authorized to upload a theme package."}, "404": {"description": "Not Found"} } } }, "/xapi/theme/active": {"get": { "tags": ["theme-api"], "summary": "Get the currently selected global theme or a role based theme if specified.", "description": "Use this to get the theme selected by the system administrator on the Theme Management page.", "operationId": "getCurrentThemeUsingGET", "consumes": ["application/json"], "produces": ["application/json"], "responses": { "200": { "description": "Reports the currently selected global theme (if there is one) and whether or not it's enabled.", "schema": {"$ref": "#/definitions/ThemeConfig"} }, "401": {"description": "Unauthorized"}, "500": {"description": "Unexpected error"}, "403": {"description": "Forbidden"}, "404": {"description": "Not Found"} } }}, "/xapi/theme/{role}": {"get": { "tags": ["theme-api"], "summary": "Get the currently selected global theme or a role based theme if specified.", "description": "Use this to get the theme selected by the system administrator on the Theme Management page.", "operationId": "themeGetUsingGET", "consumes": ["application/json"], "produces": ["application/json"], "parameters": [{ "name": "role", "in": "path", "description": "\"global\" or role name of currently set theme", "required": true, "type": "string" }], "responses": { "200": { "description": "Reports the currently selected global theme (if there is one) and whether or not it's enabled.", "schema": {"$ref": "#/definitions/ThemeConfig"} }, "401": {"description": "Unauthorized"}, "500": {"description": "Unexpected error"}, "403": {"description": "Forbidden"}, "404": {"description": "Not Found"} } }}, "/xapi/theme/{theme}": { "put": { "tags": ["theme-api"], "summary": "Sets the current global theme to the one specified.", "description": "Returns the updated serialized theme object.", "operationId": "themePutUsingPUT", "consumes": ["application/json"], "produces": ["application/json"], "parameters": [ { "name": "theme", "in": "path", "description": "The name of the theme to select.", "required": true, "type": "string" }, { "name": "enabled", "in": "query", "description": "enabled", "required": false, "type": "boolean", "default": true } ], "responses": { "200": { "description": "Successfully updated the current global theme.", "schema": {"$ref": "#/definitions/ThemeConfig"} }, "201": {"description": "Created"}, "401": {"description": "Must be authenticated to access the XNAT REST API."}, "500": {"description": "Unexpected error"}, "403": {"description": "Not authorized to create or update this user."}, "404": {"description": "Theme not found."} } }, "delete": { "tags": ["theme-api"], "summary": "Deletes the theme with the specified name.", "description": "Returns success on deletion. ", "operationId": "themeDeleteUsingDELETE", "consumes": ["application/json"], "produces": ["application/json"], "parameters": [{ "name": "theme", "in": "path", "description": "Name of the theme to delete", "required": true, "type": "string" }], "responses": { "200": { "description": "Theme was successfully deleted.", "schema": {"type": "string"} }, "401": {"description": "Must be authenticated to access the XNAT REST API."}, "500": {"description": "Unexpected error"}, "204": {"description": "No Content"}, "403": {"description": "Not authorized to delete a theme."}, "404": {"description": "Theme not found."} } } } } }
  • No labels