Publish cube to library
POST {{baseUrl}}/api/v2/cubes/:cubeId
Create a new attribute in the changeset, based on the definition provided in request body. The definition of the newly created attribute is returned in response.
In the request body, forms
contains the detailed definition of a list of attribute forms. Each attribute contains one or more attribute forms.
Each attribute form contains:
* expressions
: A list of attribute form expressions. Attribute form contains one or more attribute form expressions. Each attribute form expression contains expression
and tables
.
* ”expression”: Needs to be in either tree
or tokens
format.
* Tokens are a semi-structured representation of MicroStrategy expression text that includes object references. For example, let’s say an attribute form expression is Year - 10
. When the attribute form expression is represented as tokens, the text is broken down into pieces (tokens) with information about what these pieces represent in the metadata: (Year_ID
, YearcolumnID), (-
, Minus_ID), (10
, Constant).
* tables
: A list of tables that the expression
applies to.
* dataType
and alias
are optional. If omitted, they are calculated based on the first attribute form expression.
* childForms
is specific to a form group, which contains the reference for child forms
Provide a lookup table on either the attribute level or attribute form level, as it is required for the object to be committed to the metadata. A lookup table can be defined on the attribute level using attributeLookupTable
, or the attribute form level using lookupTable
. If LookupTable
is defined at the attribute form level, it is used, or it falls back to attributeLookupTable
.
Provide keyForm
and displays
, as they are required for the attribute to be committed to the metadata.
Provide destinationFolderId
in information
, as it is required for the attribute to be committed to the metadata.
The changeset ID can be obtained using the changeset creation API. An authorization token is required to execute the request and can be obtained using Authentication endpoints.
To save the newly created attribute to the metadata, commit using the changeset commit API.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
fields | null | Comma-separated, top-level field whitelist that allows the client to selectively retrieve part of the response model. If specified, extra filtering is applied, and for top-level object (if root model is an array, each array element), only the listed fields are kept in the response. For example, "id,elements" keeps only the "id" field and whole "elements" array field, omitting all other fields in the top-level response model. |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-MSTR-AuthToken | string | (Required) Authorization Token | |
X-MSTR-ProjectID | string | (Required) Project ID |