Create dashboard instances
This workflow sample demonstrates how to create an instance of a dashboard in memory on the intelligence server. The dashboard is based on a set of reports, dashboards, and cubes.
You can try this API with REST API Playground.
Learn more about MicroStrategy REST API Playground here.
Obtain the authorization token needed to execute the request using POST /api/auth/login.
POST /api/dossiers/instances
Creates a new instances for dashboards. It is similar to POST /api/dossiers/{dossierId}/instances but it does not require a dashboard ID. Instead, it uses the DashboardCreationInfo
object in the request body to create a new dashboard instance.
Request URL
POST /api/dossiers/instances
Request Headers
Name | Type | Description |
---|---|---|
X-MSTR-AuthToken | Header | Authorization token generated by POST /api/auth/login |
X-MSTR-ProjectID | Header | Project ID generated by GET /api/projects |
Prefer | Header | Allow client to set preferences |
Sample Request Body
The request body should contain the information for creating a new dashboard instance. Here's a sample using the DashboardCreationInfo
schema:
{
"objects": [
{
"type": 3,
"id": "E697E885F6426C1F0B794593D648AFC0"
}
],
"persistReportViewState": false,
"createForReportEditor": true,
"linkingInfo": {
"sourceInstanceId": "126620F76340F6A688ECEEB65033F625",
"promptsAnswers": "<hl mid=\"126620F76340F6A688ECEEB65033F625\" srct=\"3\" aopam=\"2\"><prms><prm id=\"D4F70D5ABA4F596ACE2844BAF90432D5\" am=\"4\" pt=\"2\" orid=\"8D679D3711D3E4981000E787EC6DE8A4\" ortp=\"12\"></prm></prms></hl>",
"selectorMode": 2,
"targetPageKey": "K53",
"vizSelection": "{\"sels\":[],\"isBranch\":false}",
"passFilter": 1,
"passInCanvasSelection": false
}
}
Please refer to the DashboardCreationInfo
and LinkingInfo
schemas for the detailed properties and descriptions.
Sample Curl Request
curl -X 'POST' 'http://demo.microstrategy.com/MicroStrategyLibrary/api/dossiers/instances' \
-H 'accept: application/json' \
-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \
-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \
-H 'Content-Type: application/json' \
-d '{
"objects":[{"type": 3,"id": "E697E885F6426C1F0B794593D648AFC0"}],
"persistReportViewState": false,
"createForReportEditor": true,
"linkingInfo": {
"sourceInstanceId": "126620F76340F6A688ECEEB65033F625",
"promptsAnswers": "<hl mid=\"126620F76340F6A688ECEEB65033F625\" srct=\"3\" aopam=\"2\"><prms><prm id=\"D4F70D5ABA4F596ACE2844BAF90432D5\" am=\"4\" pt=\"2\" orid=\"8D679D3711D3E4981000E787EC6DE8A4\" ortp=\"12\"></prm></prms></hl>",
"selectorMode": 2,
"targetPageKey": "K53",
"vizSelection": "{\"sels\":[],\"isBranch\":false}",
"passFilter": 1,
"passInCanvasSelection": false
}
}'
Sample Response
If successful, this API call returns a 201 Created
status code and the dashboard instance object in the response body. The response body follows the DocumentInstance
schema:
{
"id": "00000000000000000000000000000000",
"status": 1,
"mid": "BB4335B5594A5E2AA38CD99100A676C6"
}
HTTP Status Codes
Status Code | Description |
---|---|
201 | Created (See [Location]) |
500 | Internal Server Error |
401 | Unauthorized |
400 | Bad Request |