Update a specific transaction report definition through the Modeling service
PUT {{baseUrl}}/api/model/transactionReports/:reportId
Update a transaction report's definition through Modeling service, based on the definition provided in request body. The definition of the modified transaction report will be returned in response and will be saved to metadata at the same time. The project ID is required to create a report in metadata. An authorization token is required to execute the request and can be obtained using Authentication endpoints. Users are allowed to modify the following parts:
description
in the information
field;id
, name
, dataType
and required
of columns
field. If you don't provide the ID, a new column will be created, and don't forget to delete the reference objectId
field of the attribute form or metric that is mapped to this column;sqlExpression
field;id
, name
(if id
is provided, name changing will not take effect), forms
and column reference of attributes.id
, name
(if id
is provided, name changing will not take effect), and column reference of metrics.
Body
PARAM
Key | Datatype | Required | Description |
HEADERS
Key | Datatype | Required | Description |
X-MSTR-AuthToken
|
string | ||
X-MSTR-ProjectID
|
string |
RESPONSES
status OK
{
"information": {
"dateCreated": "2022-11-17T03:21:39.518Z",
"dateModified": "2022-11-17T03:31:18.550Z",
"versionId": "AFCFDFFB42A1CC126B8887B0DBE80F6E",
"acg": 255,
"primaryLocale": "en-US",
"objectId": "DAE07F3C4439F99E7254BCA2D971EE04",
"subType": "report_transaction",
"name": "New Transaction Report",
"destinationFolderId": "D3C7D461F69C4610AA6BAA5EF51F4125"
},
"table": {
"physicalTable": {
"columns": [
{
"id": "E76A1E30C5104B3385AA0B0B2508B7ED",
"name": "Opportunity (ID)",
"dataType": {
"type": "integer",
"precision": 4,
"scale": 0
},
"required": true
},
{
"id": "67B1D5A03D414EFFB493E9C32F325A79",
"name": "Opportunity (DESC)",
"dataType": {
"type": "fixed_length_string",
"precision": 255,
"scale": 0
},
"required": true
},
{
"id": "63F2A2BF2C004E19A985541B3A289925",
"name": "Competitor (ID)",
"dataType": {
"type": "fixed_length_string",
"precision": 255,
"scale": 0
},
"required": false
},
{
"id": "951A85B762724541AB5070FCD3A27DD4",
Curl curl -X PUT 'baseUrl/api/model/transactionReports/:reportId' -H 'X-MSTR-AuthToken: authToken' -H 'X-MSTR-ProjectID: projectId' -d '{"information":{"dateCreated":"2022-11-17T03:21:39.518Z","dateModified":"2022-11-17T03:21:39.518Z","versionId":"BACCDB6C4A246DD0E3344AAD2D324BE8","acg":255,"primaryLocale":"en-US","objectId":"DAE07F3C4439F99E7254BCA2D971EE04","subType":"report_transaction","name":"New Transaction Report"},"table":{"physicalTable":{"columns":[{"name":"Opportunity (ID)","dataType":{"type":"integer","precision":4,"scale":0},"required":true},{"id":"67B1D5A03D414EFFB493E9C32F325A79","name":"Opportunity (DESC)","dataType":{"type":"fixed_length_string","precision":255,"scale":0},"required":true},{"id":"63F2A2BF2C004E19A985541B3A289925","name":"Competitor (ID)","dataType":{"type":"fixed_length_string","precision":255,"scale":0},"required":false},{"id":"951A85B762724541AB5070FCD3A27DD4","name":"Opportunity_Size","dataType":{"type":"double","precision":18,"scale":0},"required":true}],"sqlExpression":{"tree":{"function":"concat_no_blank","children":[{"function":"repeat","functionProperties":[{"name":"Distinct","value":{"type":"boolean","value":"true"}}],"children":[{"type":"constant","variant":{"type":"string","value":" \r\n\r\nUPDATE F_SALES_OPPTY\r\nSET\r\nOPPTY_NAME = "}},{"type":"constant","variant":{"type":"string","value":"#1"}},{"type":"constant","variant":{"type":"string","value":",\r\n"}},{"function":"apply_optional","children":[{"type":"constant","variant":{"type":"string","value":"COMPETITOR = #2,"}}],"type":"operator"},{"type":"constant","variant":{"type":"string","value":"\r\nOPPTY_SIZE = "}},{"type":"constant","variant":{"type":"string","value":"#3"}},{"type":"constant","variant":{"type":"string","value":"\nWHERE\r\nOPPTY_ID = "}},{"type":"constant","variant":{"type":"string","value":"#0"}},{"type":"constant","variant":{"type":"string","value":"\r\n\r\n"}}],"type":"operator"}],"type":"operator"}}},"attributes":[{"id":"82E57B1D48B416E10CD0CAB07A1D5613","name":"Opportunity","forms":[{"id":"45C11FA478E745FEA08D781CEA190FE5","category":"ID","type":"system","displayFormat":"number","expression":{"tree":{"type":"column_reference","name":"Opportunity (ID)"}}},{"id":"CCFBE2A5EADB4F50941FB879CCF1721C","category":"DESC","type":"system","displayFormat":"text","expression":{"tree":{"type":"column_reference","objectId":"67B1D5A03D414EFFB493E9C32F325A79","name":"Opportunity (DESC)"}}}]},{"id":"3DA1E16782FC40EBBD1111662C73C863","name":"Competitor","forms":[{"id":"45C11FA478E745FEA08D781CEA190FE5","name":"ID","category":"ID","type":"system","displayFormat":"text","expression":{"tree":{"type":"column_reference","objectId":"63F2A2BF2C004E19A985541B3A289925","name":"Competitor (ID)"}}}]}],"metrics":[{"name":"Opportunity_Size","dataType":{"type":"numeric","precision":0,"scale":0},"expression":{"tree":{"type":"column_reference","objectId":"951A85B762724541AB5070FCD3A27DD4","name":"Opportunity_Size"}}}],"dataSource":{"objectId":"BCB3836D4C70EDF53CB706ABA556B44B","subType":"db_role","name":"Operational Datamart"}}}' ENDPOINTS |