Skip to main content

Save dashboard themes

Available since 2021 Update 10

tip

You can try these workflows with REST API Playground.

Learn more about MicroStrategy REST API Playground here.

This workflow sample demonstrates how to save a dashboard theme instance to metadata using POST /api/themes/dossiers/{dossierId}/instances/{instanceId}/saveAs.

tip

Get the authorization token needed to execute the request with POST /api/auth/login.

Get the project ID from GET /api/projects.

Create a new dashboard theme instance

Endpoint: POST /api/themes/dossiers/{dossierId}/instances/{instanceId}/saveAs

In this step, you are saving a dashboard theme instance to metadata as a dashboard object using POST /api/themes/dossiers/{dossierId}/instances/{instanceId}/saveAs. Dashboard theme objects are applied to dashboards for their presentation style.

tip

In path parameter, instanceId is ID of dashboard theme instance, which is created with POST /api/themes

Sample Request Header:

"accept": "application/json"
"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch"
"X-MSTR-ProjectID": "B19DEDCC11D4E0EFC000EB9495D0F44F"

Sample Request Body:

{
"name": "theme1",
"description": "Theme description",
"folderId": "28B6C20543281266286B22B8C117BC45",
"overwrite": false
}

Sample Curl:

curl -X 'POST' \
'http://localhost:8282/consume-dev/api/themes/dossiers/3C4526642940B2235E5EDF97EB009661/instances/3C4526642940B2235E5EDF97EB009661/saveAs' \
-H 'accept: application/json' \
-H 'X-MSTR-AuthToken: 7m798e0p471ip49lufeso7d6se' \
-H 'X-MSTR-ProjectID: B19DEDCC11D4E0EFC000EB9495D0F44F' \
-H 'Content-Type: application/json' \
-d '{
"name": "theme1",
"description": "Theme description",
"folderId": "28B6C20543281266286B22B8C117BC45",
"overwrite": false
}'

Sample Response Body:

You can view the new dashboard theme object ID in the body of the response. The ID provides reference to the theme object, which can be used for further options, such as applying a theme to a dashboard.

{
"id": "2E7090A9D241F962D6B191B3A1BE02D4"
}

Sample Response Code: 201 (Dashboard theme instance is saved to metadata.)