URI
<uiConfig_uri>/themes[.<format>]
Supported Methods
Parent Resource
Child Resources
Introduction
The themes resource is the iPortal theme style list resource, which includes the names, labels, and the current default theme style of iPortal.
Supported Methods:
- GET: Query the iPortal theme style list information.
- PUT: Edit iPortal theme styles, including adding themes, deleting themes, and setting the default theme.
- HEAD: Check whether the themes resource exists, or whether the permission can access the themes resource.
Supported output formats: JSON.
Resource hierarchy

HTTP Request Method
Perform an HTTP request on the following URI. The json output format is used as an example, where supermapiportal is the server name.
http://supermapiportal:8190/iportal/web/uiconfig/themes.json
GET Request
Query the iPortal theme style list information.
Response Structure
Perform a GET request on the themes resource to retrieve the iPortal theme style list information. The returned resource representation structure is as follows:
| Name | Type | Description |
| themes | String[] | The iPortal theme style list information. |
| default | String | The default theme style used by iPortal. |
Response Example
Perform a GET request on the themes resource: http://localhost:8190/iportal/web/uiconfig/themes.json. The returned json representation is as follows:
{
"themes": [
{
"name": "ThemeSetting_blue",
"label": "Blue Theme"
},
{
"name": "ThemeSetting_orange",
"label": "Orange Theme"
}
],
"default": "ThemeSetting_blue"
}
POST Request
Add a new theme style. Only iPortal administrators have the permission to add new themes.
Request Parameters
When sending a request, you need to pass the following parameters in the request body:
| Name | Type | Description |
| name | String | The name of the new theme. |
| label | String | The label of the new theme. |
| content | String | The specific configuration of the new theme. |
Response Structure
The returned resource representation structure is as follows:
| Field | Type | Description |
| succeed | boolean | Whether adding the theme style is successful. |
| error | HttpError | Error information. If the addition is successful, this field is not returned. |
Response Example
Perform a POST request on the themes resource: http://localhost:8190/iportal/web/uiconfig/themes.json to add a new theme. The request body is as follows:
{
"name": "custom",
"label": "Custom Theme",
"content": {
"themeSetting": {
"header": {
"backgroundColor": "rgb(255, 255, 255)",
"color": "rgb(51, 51, 51)",
"hoverBackgroundColor": "#ef5555",
"hoverFontColor": "#0161b7"
},
"resourceHeader": {
"backgroundColor": "rgb(23,11,11)",
"color": "#ffffff",
"hoverBannerFontColor": "#40a9ff"
},
"resourceAside": {
"borderColor": "#E5E5E5",
"activeBackgroundColor": "#f4f4f4"
},
"body": {
"backgroundColor": "#f4f4f4"
},
"button": {
"primaryColor": "#127fdc",
"textColor": "rgba(0, 0, 0, .65)",
"borderColorBase": "#d9d9d9"
},
"footer": {
"backgroundColor": "rgb(255, 255, 255)",
"color": "rgb(51, 51, 51)",
"borderColor": "#f4f4f4"
}
}
}
}
The returned json representation is as follows:
{"succeed": true}
PUT Request
Edit the iPortal theme style list, supporting iPortal administrators in deleting themes, setting the default theme, etc. via PUT requests.
Request Parameters
When sending a request, you need to pass the following parameters in the request body:
| Name | Type | Description |
| themes | String[] | The edited iPortal theme style list. |
| default | String | The default theme style used by iPortal. |
Response Structure
The returned resource representation structure is as follows:
| Field | Type | Description |
| succeed | boolean | Whether editing the iPortal theme style list is successful. |
| error | HttpError | Error information. If the editing is successful, this field is not returned. |
Response Example
Perform a PUT request on the themes resource: http://localhost:8190/iportal/web/uiconfig/themes.json to set a custom theme style as the iPortal default theme. The request body is as follows:
{
"themes": [
{
"name": "ThemeSetting_blue",
"label": "Blue Theme"
},
{
"name": "ThemeSetting_orange",
"label": "Orange Theme"
},
{
"name": "ThemeSetting_custom",
"label": "Custom Theme"
}
],
"default": "ThemeSetting_custom"
}
The returned json representation is as follows:
{"succeed": true}
HEAD Request
Returns the same HTTP response headers as a GET request, but without a response entity. You can obtain the metadata information contained in the response message headers without transferring the entire response content. The metadata information includes media type, character encoding, compression encoding, entity content length, etc.
A HEAD request can be used to determine whether the themes resource exists, or whether the client has permission to access the themes resource. By performing a HEAD request on a URI with .<format> appended, you can also quickly determine whether the themes resource supports the <format> representation.