Logo
MicroStrategy REST API API Documentation

Create a datamart through the Modeling service

POST {{baseUrl}}/api/model/datamarts

 

Body PARAM

Key Datatype Required Description 
showExpressionAs
string This parameter specifies the format in which the expressions are returned in response. This parameter applies to the expressions in a fact or attribute and custom expressions used in a filter, prompt, security filter, custom group, etc. Expressions are presented in the following formats: * "text": A human readable, but non-parsable text, describing the expression. This is the default format that is always returned in the response. * "tree": A tree data structure fully defining the expression. This format can be used if you want to examine and modify the expression programmatically. * "tokens": A list of parsed tokens. This format can be used if you want to examine and modify the expression using the parser component. Note that generating tokens requires additional time. Tokens are a semi-structured representation of MicroStrategy expression text that includes object references. For example, let’s say a filter expression is "Revenue > Cost". When the filter expression is represented as tokens, the text is broken down into pieces (tokens) with information about what these pieces represent in the metadata: ("Revenue", Revenue_ID), (">", GreaterThan_ID), ("Cost", Cost_ID). If omitted, the expression is returned in "text" format. If `tree`, the expression is returned in "text" and "tree" formats. If `tokens`, the expression is returned in "text" and "tokens" formats.
showFilterTokens
boolean Specify whether the "condition" in filter is returned in "tokens" format, along with "text" and "tree" formats. The "condition" in threshold is presented in the following formats: * "text": A human readable, but non-parsable text, describing a condition's qualification. * "tree": A tree data structure fully defining the condition's qualification. * "tokens": A list of parsed tokens that define a condition's qualification. Be aware that generating tokens requires additional time. If omitted or `false`, only "text" and "tree" formats are returned. If `true`, all "text", "tree" and "tokens" formats are returned.
showAdvancedProperties
boolean Specify whether to retrieve the values of the advanced properties. The advanced properties are presented in the following groups: "vldbProperties": A list of properties as determined by the common infrastructure. "metricJoinTypes": A list of Metric Join Types, one for each metric that appears in the template. "attributeJoinTypes": A list of Attribute Join Types, one for each attribute that appears in the template. If omitted or false, nothing will be returned for the advanced properties. If true, all applicable advanced properties are returned.
sourceReport
string (Optional) report ID This parameter is used when user want to create a data mart report based on a report object. In this way, data mart report will be created based on the source report template design and the data mart options in request body. If the parameter is not provided, data mart report will be created based on the definition provided in request body.



HEADERS

Key Datatype Required
Curl
curl -X POST 'baseUrl/api/model/datamarts?showExpressionAs=tokens&showFilterTokens=true&showAdvancedProperties=true&sourceReport=rd_sourceReportId' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-ProjectID: projectId' -d '{"information":{"destinationFolderId":"publicObjectsFolderId","subType":"report_datamart","name":"01_dmr_new"},"sourceType":"normal","dataSource":{"dataTemplate":{"units":[{"id":"8D679D3811D3E4981000E787EC6DE8A4","name":"Country","type":"attribute"},{"id":"8D679D3611D3E4981000E787EC6DE8A4","name":"Catalog","type":"attribute"},{"id":"8D679D3511D3E4981000E787EC6DE8A4","name":"Call Center","type":"attribute"},{"id":"8D679D5211D3E4981000E787EC6DE8A4","name":"Distribution Center","type":"attribute"},{"id":"8D679D4F11D3E4981000E787EC6DE8A4","name":"Subcategory","type":"attribute"},{"type":"metrics","elements":[{"id":"7FD5B69611D5AC76C000D98A4CC5F24F","name":"Cost","subType":"metric"},{"id":"D823D64B48A0104B01135587BA87A2BD","name":"Cost Growth","subType":"metric"},{"id":"381980B211D40BC8C000C8906B98494F","name":"Discount","subType":"metric"}]}]}},"datamartOptions":{"append":true,"targetSource":{"objectId":"A23BBC514D336D5B4FCE919FE19661A3","subType":"db_role","name":"Tutorial Warehouse"},"tableName":"dm_sample","placeholderIncluded":true,"datamartProperties":{"DatamartProperties":{".":{"Create Table Post String":{"name":"Create Table Post String","value":"","type":"string","resolvedLocation":"object"},"Insert SQLs":{"name":"Insert SQLs","value":"","type":"string","resolvedLocation":"object"},"Maximum Execution Time":{"name":"Maximum Execution Time","value":"0","type":"int32","resolvedLocation":"object"},"Maximum Rows":{"name":"Maximum Rows","value":"65536","type":"int32","resolvedLocation":"object"},"Post SQLs":{"name":"Post SQLs","value":"","type":"string","resolvedLocation":"object"},"Pre SQLs":{"name":"Pre SQLs","value":"","type":"string","resolvedLocation":"object"},"Table Descriptor":{"name":"Table Descriptor","value":"","type":"string","resolvedLocation":"object"},"Table Option":{"name":"Table Option","value":"","type":"string","resolvedLocation":"object"},"Table Prefix":{"name":"Table Prefix","value":"","type":"string","resolvedLocation":"object"},"Table Qualifier":{"name":"Table Qualifier","value":"","type":"string","resolvedLocation":"object"},"Table Space":{"name":"Table Space","value":"","type":"string","resolvedLocation":"object"},"Table Type":{"name":"Table Type","value":"0","type":"int32","resolvedLocation":"object"}}}}}}'

ENDPOINTS