Create a derived element
POST {{baseUrl}}/api/model/derivedElements
This API creates a derived element in this changeset. When creating a derived element, the API also creates a list of the derived element's elements defined in
the request body and then returns the full definition of the newly created derived element. The request body must include the objectInfoReference of the attribute whose attribute elements you intend to group. Please provide destinationFolderId, it is
required for the object to be committed to metadata. A changeset ID is required to execute the request, and it 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 add the newly created derived element to metadata, commit using the POST /model/{changesetId}/commit API.
Body
PARAM
Key | Datatype | Required | Description |
HEADERS
Key | Datatype | Required | Description |
X-MSTR-AuthToken
|
string | (Required) Authorization Token | |
X-MSTR-MS-Changeset
|
string | (Required) Changeset ID | |
Content-Type
|
string |
RESPONSES
status Created
{
"information": {
"versionId": "F72F13044BAD4EF9A5CA2F3C26590ED5",
"primaryLocale": "en-US",
"objectId": "4E75BA29C537478F8478F641A35C3CC1",
"subType": "consolidation_element",
"name": "grouped derived element",
"destinationFolderId": "D3C7D461F69C4610AA6BAA5EF51F4125"
},
"attribute": {
"objectId": "5603951E4FE1BC04A44E44B85BBB8ED2",
"subType": "attribute",
"name": "Age Range"
},
"elements": [
{
"id": "007CA6FCAAC64F65BDF0562096393335",
"name": "Age under 34",
"type": "list",
"format": {
"header": [],
"values": []
},
"options": {
"display": "this_element",
"subtotal": "this_element",
"includeIndividual": false
},
"text": "Under 24, 25 to 34",
"elements": [
{
"display": "Under 24",
"elementId": "h1"
},
{
"display": "25 to 34",
"elementId": "h2"
}
]
},
{
Curl curl -X POST 'baseUrl/api/model/derivedElements' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-MS-Changeset: rd_changesetId' -H 'Content-Type: application/json' -d '{"information":{"name":"grouped derived element","destinationFolderId":"folderId"},"attribute":{"objectId":"5603951E4FE1BC04A44E44B85BBB8ED2"},"elements":[{"name":"Age under 34","type":"list","elements":[{"display":"Under 24","elementId":"h1"},{"display":"25 to 34","elementId":"h2"}]},{"name":"All Other","type":"all_other"}]}' ENDPOINTS |