diff --git a/docs/common-workflows/mosaic/manage-data-model-attribute-objects/manage-data-model-attribute-objects.md b/docs/common-workflows/mosaic/manage-data-model-attribute-objects/manage-data-model-attribute-objects.md new file mode 100644 index 00000000..a61159fa --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-attribute-objects/manage-data-model-attribute-objects.md @@ -0,0 +1,20 @@ +--- +title: Manage data model attribute objects +description: You can use REST API requests to retrieve an attribute's elements in data model. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +You can use REST API requests to retrieve an attribute's elements in data model: + +- [Retrieve an Attribute's Elements in Data Model](retrieve-an-attributes-elements-in-data-model.md) + +For more information about the Modeling service, see [Configuring the Modeling Service](https://www2.microstrategy.com/producthelp/Current/InstallConfig/en-us/Content/modeling_service.htm). diff --git a/docs/common-workflows/mosaic/manage-data-model-attribute-objects/retrieve-an-attributes-elements-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-attribute-objects/retrieve-an-attributes-elements-in-data-model.md new file mode 100644 index 00000000..6eceaa65 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-attribute-objects/retrieve-an-attributes-elements-in-data-model.md @@ -0,0 +1,70 @@ +--- +title: Retrieve an attribute's elements in data model +sidebar_label: Retrieve an attribute's elements in data model +description: This workflow sample demonstrates how to retrieve an attribute's elements in data model. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +This workflow sample demonstrates how to retrieve an attribute's elements in data model. + +:::info + +Get the authorization token needed to execute the request with [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +Retrieve the attribute's elements using `GET /api/dataModels/{dataModelId}/attributes/{id}/elements`. + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "4bb7n1dhjo860e7tlpchg57hl" +"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X GET "https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/attributes/8D679D5111D3E4981000E787EC6DE8A4/elements" -H "accept: application/json" -H "X-MSTR-AuthToken: 4bb7n1dhjo860e7tlpchg57hl" -H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Response Body: + +You can view the data model's attribute's elements in the response body. + +```json +[ + { + "name": "2015", + "id": "h2015;;2015" + }, + { + "name": "2016", + "id": "h2016;;2016" + }, + { + "name": "2017", + "id": "h2017;;2017" + }, + { + "name": "2018", + "id": "h2018;;2018" + } +] +``` + +Response Code 200: (The attribute's elements is returned successfully.) diff --git a/docs/common-workflows/mosaic/manage-data-model-object-acl/manage-data-model-object-acl.md b/docs/common-workflows/mosaic/manage-data-model-object-acl/manage-data-model-object-acl.md new file mode 100644 index 00000000..84c42a9e --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-object-acl/manage-data-model-object-acl.md @@ -0,0 +1,21 @@ +--- +title: Manage data model object acl +description: You can use REST API requests to retrieve and update acl of objects in data model through the Modeling service. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +You can use REST API requests to retrieve and update acl of objects in data model through the Modeling service. + +- [Get ACL of an object in a Data Model](retrieve-a-data-model-object-acl.md) +- [Update ACL of an object in a Data Model](update-a-data-model-object-acl.md) + +For more information about the Modeling service, see [Configuring the Modeling Service](https://www2.microstrategy.com/producthelp/Current/InstallConfig/en-us/Content/modeling_service.htm). diff --git a/docs/common-workflows/mosaic/manage-data-model-object-acl/retrieve-a-data-model-object-acl.md b/docs/common-workflows/mosaic/manage-data-model-object-acl/retrieve-a-data-model-object-acl.md new file mode 100644 index 00000000..908a3b91 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-object-acl/retrieve-a-data-model-object-acl.md @@ -0,0 +1,85 @@ +--- +title: Retrieve acl of an object inside a data model +description: You can use REST API requests to retrieve acl of an object inside a data model. +--- + + + +:::tip + +You can try out this workflow at [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +You can use REST APIs to retrieve the acl of an object inside a data model through the Modeling service. + +## Retrieve acl of an attribute inside a data model + +There is a "Customer Statistics" data model with an "A44F79895E9247719292556AA14373F5" ID. This data model contains a "Customer" attribute with an "B9E7FD5911D3E936C000B3B2D86C964F" ID. +You want to get the acl of the "Customer" attribute. + +:::info + +To get the authorization token needed to execute the request, use `POST /api/auth/login`. + +Get the project ID from `GET /api/projects`. + +::: + +:::tip + +Changesets are used in this workflow. For information on how to create and use changesets, see [Changesets](/docs/common-workflows/modeling/changesets.md). + +::: + +To get the acl of the object in your data model, use [GET /api/model/dataModels/\{dataModelId}/objects/\{objectId}/acl](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Models/getDataModelObjectAcl). + +Sample Request Header + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch" +"X-MSTR-MS-Changeset": "0E9F01172ECF4BA2BB510F7B9FB4F6E8" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X GET "https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/A44F79895E9247719292556AA14373F5/objects/B9E7FD5911D3E936C000B3B2D86C964F/acl?subType=attribute" -H "accept: application/json" -H "X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch" -H "X-MSTR-MS-Changeset: 0E9F01172ECF4BA2BB510F7B9FB4F6E8" +``` + +Sample Response Body: + +```json +{ + "acl": { + "294DEDC011D2F1D56000D98E67019608": { + "granted": 255, + "denied": 0, + "inheritable": false, + "name": "Public / Guest", + "subType": "user_group" + }, + "C82C6B1011D2894CC0009D9F29718E4F": { + "granted": 45, + "denied": 16, + "inheritable": false, + "name": "Everyone", + "subType": "user_group" + }, + "D5ABCBF54937420EC3377FA23857A4DC": { + "granted": 255, + "denied": 0, + "inheritable": false, + "name": "F40308_automodel", + "subType": "user" + } + } +} +``` + +Response Code: 200 diff --git a/docs/common-workflows/mosaic/manage-data-model-object-acl/update-a-data-model-object-acl.md b/docs/common-workflows/mosaic/manage-data-model-object-acl/update-a-data-model-object-acl.md new file mode 100644 index 00000000..16041283 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-object-acl/update-a-data-model-object-acl.md @@ -0,0 +1,113 @@ +--- +title: Update acl of an object inside a data model +description: You can use REST API requests to update acl of an object inside a data model. +--- + + + +:::tip + +You can try out this workflow at [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +You can use REST APIs to update the acl of an object inside a data model through the Modeling service. + +## Update acl of a metric inside a data model + +There is a "Customer Statistics" data model with an "A44F79895E9247719292556AA14373F5" ID. This data model contains a "Sales" metric with an "B9E7FD5911D3E936C000B3B2D86C964F" ID. +You want to update the acl of the "Sales" metric. + +:::info + +To get the authorization token needed to execute the request, use `POST /api/auth/login`. + +Get the project ID from `GET /api/projects`. + +::: + +:::tip + +Changesets are used in this workflow. For information on how to create and use changesets, see [Changesets](/docs/common-workflows/modeling/changesets.md). + +::: + +To update the acl of the object in your data model, use [PATCH /api/model/dataModels/\{dataModelId}/objects/\{objectId}/acl](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Models/updateDataModelObjectAcl). + +Sample Request Header + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch" +"X-MSTR-MS-Changeset": "0E9F01172ECF4BA2BB510F7B9FB4F6E8" +``` + +Sample Request Body: + +```json +{ + "acl": { + "294DEDC011D2F1D56000D98E67019608": { + "granted": 255, + "denied": 0, + "inheritable": false, + "name": "Public / Guest", + "subType": "user_group" + }, + "C82C6B1011D2894CC0009D9F29718E4F": { + "granted": 45, + "denied": 16, + "inheritable": false, + "name": "Everyone", + "subType": "user_group" + }, + "D5ABCBF54937420EC3377FA23857A4DC": { + "granted": 255, + "denied": 0, + "inheritable": false, + "name": "F40308_automodel", + "subType": "user" + } + } +} +``` + +Sample Curl: + +```bash +curl -X PATCH "https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/A44F79895E9247719292556AA14373F5/objects/B9E7FD5911D3E936C000B3B2D86C964F/acl?subType=metric" -H "accept: application/json" -H "X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch" -H "X-MSTR-MS-Changeset: 0E9F01172ECF4BA2BB510F7B9FB4F6E8" -d '{"acl":{"294DEDC011D2F1D56000D98E67019608":{"granted":255,"denied":0,"inheritable":false,"name":"Public / Guest","subType":"user_group"},"C82C6B1011D2894CC0009D9F29718E4F":{"granted":45,"denied":16,"inheritable":false,"name":"Everyone","subType":"user_group"},"D5ABCBF54937420EC3377FA23857A4DC":{"granted":255,"denied":0,"inheritable":false,"name":"F40308_automodel","subType":"user"}}}' +``` + +Sample Response Body: + +```json +{ + "acl": { + "294DEDC011D2F1D56000D98E67019608": { + "granted": 255, + "denied": 0, + "inheritable": false, + "name": "Public / Guest", + "subType": "user_group" + }, + "C82C6B1011D2894CC0009D9F29718E4F": { + "granted": 45, + "denied": 16, + "inheritable": false, + "name": "Everyone", + "subType": "user_group" + }, + "D5ABCBF54937420EC3377FA23857A4DC": { + "granted": 255, + "denied": 0, + "inheritable": false, + "name": "F40308_automodel", + "subType": "user" + } + } +} +``` + +Response Code: 200 diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/create-a-security-filter-object-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/create-a-security-filter-object-in-data-model.md new file mode 100644 index 00000000..2a59334b --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/create-a-security-filter-object-in-data-model.md @@ -0,0 +1,151 @@ +--- +title: Create a security filter object in data model +sidebar_label: Create a security filter object in data model +description: This workflow sample demonstrates how to create a security filter object in data model through the Modeling service. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +This workflow sample demonstrates how to create a security filter object in data model through the Modeling service. + +1. Create a changeset. +1. [Create a security filter in data model.](#create-a-security-filter-in-data-model) +1. Commit a changeset. +1. Delete the changeset. + +In this workflow sample, you want to create a "Year > 2015" security filter object in data model in the MicroStrategy Tutorial project. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. The MicroStrategy Tutorial project ID is `B7CA92F04B9FAE8D941C3E9B7E0CD754`. + +:::info + +Get the authorization token needed to execute the request with [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +Changesets are used in this workflow. For information on how to create and use changesets, see [Changesets](/docs/common-workflows/modeling/changesets.md). + +## Create a security filter in data model + +Use [POST /api/model/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/ms-postDataModelSecurityFilter) with `"tree"` format for the `"qualifications"`. For more examples of creating a new security filter, see [Security Filters](/docs/common-workflows/modeling/manage-security-filter-objects/create-a-security-filter-object.md) section. + +To create a security filter, in the request body, the security filter’s "qualification" must be in either "tree" or "tokens" format. If you add both formats, only "tree" is used. + +If you create an attribute element list qualification, only the “tree“ format is supported. + +If you create a qualification with inline custom expressions, only the "tree" format is supported. + +Any embedded objects (`"isEmbedded":true"`) cannot be used to create a new security filter. Any attributes outside the data model cannot be used to create a new security filter. + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "ns42kvi9lb36ae7g3scphn0ga9" +"X-MSTR-MS-Changeset": "8DF1659E9D74484D9D47B9478D4C7D00" +``` + +Sample Request Body: + +```json +{ + "information": { + "subType": "md_security_filter", + "name": "Year > 2015" + }, + "qualification": { + "tree": { + "type": "predicate_form_qualification", + "predicateTree": { + "function": "greater", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "double", + "value": "2015.0" + } + } + ], + "attribute": { + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system", + "name": "ID" + } + } + } + }, + "topLevel": [], + "bottomLevel": [] +} +``` + +Sample Curl: + +```bash +curl -X POST "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters" -H "accept: application/json" -H "X-MSTR-AuthToken: ns42kvi9lb36ae7g3scphn0ga9" -H "X-MSTR-MS-Changeset: 8DF1659E9D74484D9D47B9478D4C7D00" -H "Content-Type: application/json" -d '{"information":{"subType":"filter","name":"Year > 2015","destinationFolderId":"98FE182C2A10427EACE0CD30B6768258"},"qualification":{"tree":{"type":"predicate_form_qualification","predicateTree":{"function":"greater","parameters":[{"parameterType":"constant","constant":{"type":"double","value":"2015.0"}}],"attribute":{"objectId":"8D679D5111D3E4981000E787EC6DE8A4","subType":"attribute","name":"Year"},"form":{"objectId":"45C11FA478E745FEA08D781CEA190FE5","subType":"attribute_form_system","name":"ID"}}}}}' +``` + +Sample Response Body: + +You can view the new filter's definition in the response body. + +```json +{ + "information": { + "versionId": "88DF4A68957941EBBBC69B975B2D011F", + "primaryLocale": "en-US", + "objectId": "8981A1EB828F4888959C0C0A435870CC", + "subType": "md_security_filter", + "name": "Year > 2015", + "destinationFolderId": "EE9BD70043F0F571B38E43BF19B9301A" + }, + "qualification": { + "text": "Year (ID) > 2015", + "tree": { + "type": "predicate_form_qualification", + "predicateId": "43F6594B23BF4510A090F5AB3C44358F", + "predicateText": "Year (ID) > 2015", + "predicateTree": { + "function": "greater", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "double", + "value": "2015.0" + } + } + ], + "attribute": { + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system", + "name": "ID" + } + } + } + }, + "topLevel": [], + "bottomLevel": [] +} +``` + +Response Code: 201 (A new data model security filter is created successfully in the changeset.) diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/delete-a-security-filter-object-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/delete-a-security-filter-object-in-data-model.md new file mode 100644 index 00000000..c1713a91 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/delete-a-security-filter-object-in-data-model.md @@ -0,0 +1,56 @@ +--- +title: Delete a security filter definition in data model +sidebar_label: Delete a security filter definition in data model +description: This workflow sample demonstrates how to delete a security filter object in data model through the Modeling service. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +This workflow sample demonstrates how to delete a security filter object in a data model using the Modeling service. + +1. Create a changeset using `POST /api/model/changesets` +1. [Delete the security filter in data model using `DELETE /api/model/dataModels/{dataModelId}/securityFilters/{securityFilterId}`](#delete-the-security-filter-in-data-model-using-delete-apimodeldatamodelsdatamodelidsecurityfilterssecurityfilterid) +1. Commit the changeset using `POST /api/model/changesets/{changesetId}/commit`](#3-commit-the-changeset-using-post-apimodelchangesetschangesetidcommit) +1. Delete the changeset using `DELETE /api/model/changesets/{changesetId}` + +In this workflow sample, you want to delete the `"Year > 2015"` security filter object in data model in the MicroStrategy Tutorial project. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. The object ID of the security filter is `8981A1EB828F4888959C0C0A435870CC`. + +:::info + +To get the authorization token needed to execute the request, use [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +Changesets are used in this workflow. For information on how to create and use changesets, see [Changesets](/docs/common-workflows/modeling/changesets.md). + +## Delete the security filter in data model using [DELETE /api/model/dataModels/\{dataModelId}/securityFilters/\{securityFilterId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/ms-deleteDataModelSecurityFilter) + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "frbicqfk7btoggg5bnu450hrqt" +"X-MSTR-MS-Changeset": "C4F6B0E4C87F46EF9B6C5690DFFF87C1" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X DELETE "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters/8981A1EB828F4888959C0C0A435870CC" -H "accept: application/json" -H "X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch" -H "X-MSTR-MS-Changeset: C4F6B0E4C87F46EF9B6C5690DFFF87C1" +``` + +Sample Response Body: Empty + +Sample Response Code: 204 (The security filter has been deleted successfully from the data model.) diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/manage-data-model-security-filter-objects.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/manage-data-model-security-filter-objects.md new file mode 100644 index 00000000..2dac4d3f --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/manage-data-model-security-filter-objects.md @@ -0,0 +1,26 @@ +--- +title: Manage data model security filter objects +description: You can use REST API requests to retrieve, create and update security filter objects in data model through the Modeling service. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +You can use REST API requests to retrieve, create, and update security filter objects through the Modeling service: + +- [Create a Security Filter Object in Data Model](create-a-security-filter-object-in-data-model.md) +- [Update a Security Filter Object in Data Model](update-a-security-filter-object-in-data-model.md) +- [Retrieve a Security Filter Definition in Data Model](retrieve-a-security-filter-definition-in-data-model.md) +- [Retrieve all Security Filters in Data Model](retrieve-all-security-filters-in-data-model.md) +- [Retrieve a Security Filter's Member in Data Model](retrieve-a-security-filters-member-in-data-model.md) +- [Modify a Security Filter's Member in Data Model](modify-a-security-filters-member-in-data-model.md) +- [Delete a Security Filter Object in Data Model](delete-a-security-filter-object-in-data-model.md) + +For more information about the Modeling service, see [Configuring the Modeling Service](https://www2.microstrategy.com/producthelp/Current/InstallConfig/en-us/Content/modeling_service.htm). diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/modify-a-security-filters-member-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/modify-a-security-filters-member-in-data-model.md new file mode 100644 index 00000000..33a31b45 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/modify-a-security-filters-member-in-data-model.md @@ -0,0 +1,96 @@ +--- +title: Modify a security filter's member in data model +sidebar_label: Modify a security filter's member in data model +description: This workflow sample demonstrates how to modify the users and user groups that a specified security filter in data model is applied to. +--- + + + +:::tip + +You can try out this workflow at [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +This workflow sample demonstrates how to modify the users and user groups that a specified security filter in data model is applied to. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. The object ID of the security filter is `8981A1EB828F4888959C0C0A435870CC`. + +1. [Remove the users and user groups using `PATCH /api/dataModels/{dataModelId}/securityFilters/{id}/members`](#1-remove-the-users-and-user-groups-using-patch-apidatamodelsdatamodelidsecurityfiltersidmembers) +1. [Add the users and user groups using `PATCH /api/dataModels/{dataModelId}/securityFilters/{id}/members`](#2-add-the-users-and-user-groups-using-patch-apidatamodelsdatamodelidsecurityfiltersidmembers) + +:::info + +To get the authorization token needed to execute the request, use [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +## 1. Remove the users and user groups using [PATCH /api/dataModels/\{dataModelId}/securityFilters/\{id}/members](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/updatePartialSecurityFilter) + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "pamr302kmu0q1l0c22jeb13s2q" +"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Request Body: + +```json +{ + "operationList": [ + { + "op": "removeElements", + "path": "/members", + "value": ["D09773F94699124B4D75B48F1B358327", "54F3D26011D2896560009A8E67019608"] + } + ] +} +``` + +Sample Curl: + +```bash +curl -X PATCH "http://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters/8981A1EB828F4888959C0C0A435870CC/members" -H "accept: */*" -H "X-MSTR-AuthToken: pamr302kmu0q1l0c22jeb13s2q" -H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754" -H "Content-Type: application/json" -d '{"operationList":[{"op":"removeElements","path":"/members","value":["D09773F94699124B4D75B48F1B358327","54F3D26011D2896560009A8E67019608"]}]}' +``` + +Sample Response Body: Empty + +Response Code: 204 (The security filter's member is modified successfully.) + +## 2. Add the users and user groups using [PATCH /api/dataModels/\{dataModelId}/securityFilters/\{id}/members](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/updatePartialSecurityFilter) + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "pamr302kmu0q1l0c22jeb13s2q" +"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Request Body: + +```json +{ + "operationList": [ + { + "op": "addElements", + "path": "/members", + "value": ["D09773F94699124B4D75B48F1B358327", "54F3D26011D2896560009A8E67019608"] + } + ] +} +``` + +Sample Curl: + +```bash +curl -X PATCH "http://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters/8981A1EB828F4888959C0C0A435870CC/members" -H "accept: */*" -H "X-MSTR-AuthToken: pamr302kmu0q1l0c22jeb13s2q" -H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754" -H "Content-Type: application/json" -d '{"operationList":[{"op":"addElements","path":"/members","value":["D09773F94699124B4D75B48F1B358327","54F3D26011D2896560009A8E67019608"]}]}' +``` + +Sample Response Body: Empty + +Response Code: 200 (The security filter's member is modified successfully.) diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filter-definition-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filter-definition-in-data-model.md new file mode 100644 index 00000000..3a69b5c9 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filter-definition-in-data-model.md @@ -0,0 +1,288 @@ +--- +title: Retrieve a security filter definition in data model +sidebar_label: Retrieve a security filter definition in data model +description: This workflow sample demonstrates how to retrieve a security filter's definition in data model through the Modeling service. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +This workflow sample demonstrates how to retrieve a security filter's definition in data model through the Modeling service. + +1. Create a changeset using `POST /api/model/changesets` +1. [Retrieve a data model's security filter's definition using `GET /api/model/dataModels/{dataModelId}/securityFilters/{securityFilterId}`](#retrieve-a-data-models-security-filters-definition) +1. [Retrieve a data model's security filter's definition in tokens format using `GET /api/model/dataModels/{dataModelId}/securityFilters/{securityFilterId}?showFilterTokens=true`](#retrieve-a-data-models-security-filters-definition-in-tokens-format) +1. Delete the changeset using `DELETE /api/model/changesets/{changesetId}` + +### Create a changeset + +Use [POST /api/model/changesets](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Changesets/ms-createChangeset). + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch" +"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X POST "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/changesets" -H "accept: application/json" -H "X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch" -H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Response Body: + +```json +{ + "id": "0E9F01172ECF4BA2BB510F7B9FB4F6E8", + "dateCreated": "2025-08-11T16:38:09.825650Z", + "dateModified": "2025-08-11T16:38:09.825665Z", + "status": "Ready", + "schemaEdit": false, + "userName": "MSTR User", + "mstrProjectId": "B7CA92F04B9FAE8D941C3E9B7E0CD754", + "mstrUserId": "7FC05A65473CE2FD845CE6A1D3F13233", + "userDateNumberLocale": "en-US", + "userMetadataLocale": "en-US", + "userWarehouseLocale": "en-US" +} +``` + +Sample Response Code: 200 (A new changeset is created successfully.) + +### Retrieve a data model's security filter's definition + +In this workflow sample, you want to get the definition of the "Year > 2015" security filter object. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. The object ID of the security filter is `8981A1EB828F4888959C0C0A435870CC` in the MicroStrategy Tutorial project. The project ID is `B7CA92F04B9FAE8D941C3E9B7E0CD754`. + +Use [GET /api/model/dataModels/\{dataModelId}/securityFilters/\{securityFilterId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/ms-getDataModelSecurityFilter). + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch" +"X-MSTR-MS-Changeset": "0E9F01172ECF4BA2BB510F7B9FB4F6E8" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X GET "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters/8981A1EB828F4888959C0C0A435870CC" -H "accept: application/json" -H "X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch" -H "X-MSTR-MS-Changeset: 0E9F01172ECF4BA2BB510F7B9FB4F6E8" +``` + +Sample Response Body: + +You can view the security filter's definition in the response body. + +```json +{ + "information": { + "dateCreated": "2025-08-11T07:37:35.858Z", + "dateModified": "2025-08-11T07:37:35.858Z", + "versionId": "88DF4A68957941EBBBC69B975B2D011F", + "primaryLocale": "en-US", + "objectId": "8981A1EB828F4888959C0C0A435870CC", + "subType": "md_security_filter", + "name": "Year > 2015" + }, + "qualification": { + "text": "Year (ID) > 2015", + "tree": { + "type": "predicate_form_qualification", + "predicateId": "62EE53C755F64508BAEE99989E9EACCC", + "predicateText": "Year (ID) > 2015", + "predicateTree": { + "function": "greater", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "double", + "value": "2015.0" + } + } + ], + "attribute": { + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system", + "name": "ID" + } + } + } + }, + "topLevel": [], + "bottomLevel": [] +} +``` + +Response Code: 200 (The data model's security filter's definition is returned successfully.) + +### Retrieve a data model's security filter's definition in tokens format + +In this workflow sample, you want to get the definition of the "Year > 2015" security filter object in data model. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. The object ID of the security filter is `8981A1EB828F4888959C0C0A435870CC` in the MicroStrategy Tutorial project. This procedure is similar to [Retrieve a data model's security filter's definition](#retrieve-a-data-models-security-filters-definition), except you want to enable the `showFilterTokens` parameter to retrieve the security filter's definition in tokens format. + +:::tip + +Security filter tokens are used the same as filter tokens. Tokens are a semi-structured representation of expression text that includes object references. For example, let's say a security filter expression is "Revenue > Cost". When the security 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).

A security filter's "qualification" is presented in the following formats: + +- "text": A human-readable, but non-parsable text, describing a filter's qualification. +- "tree": A tree data structure fully defining the filter's qualification. +- "tokens": A list of parsed tokens that define a filter's qualification. Be aware that generating tokens requires additional time. + +If `showFilterTokens` is omitted or `false`, only "text" and "tree" formats return.
If `showFilterTokens` is `true`, all "text", "tree" and "tokens" formats return. + +::: + +To get the security filter's definition in tokens format, use [GET /api/model/dataModels/\{dataModelId}/securityFilters/\{securityFilterId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/ms-getDataModelSecurityFilter) with `showFilterTokens=true`. + +Sample Curl: + +```bash +curl -X GET "https://demo.cloud.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters/8981A1EB828F4888959C0C0A435870CC?showFilterTokens=true" -H "accept: application/json" -H "X-MSTR-AuthToken: mcgi1hfofet0f1nhs3u3kjurah" -H "X-MSTR-MS-Changeset: 0E9F01172ECF4BA2BB510F7B9FB4F6E8"" +``` + +Sample Response Body: + +You can view the security filter's definition in the body of the response. Note that compared to [Retrieve a data model's security filter's definition](#retrieve-a-data-models-security-filters-definition), "qualification"`has an extra`"tokens"` field. + +```json +{ + "information": { + "dateCreated": "2025-08-11T07:37:35.858Z", + "dateModified": "2025-08-11T07:37:35.858Z", + "versionId": "6602277211EB330B01430080EF051B59", + "primaryLocale": "en-US", + "objectId": "8981A1EB828F4888959C0C0A435870CC", + "subType": "md_security_filter", + "name": "Year > 2015" + }, + "qualification": { + "text": "Year (ID) > 2015", + "tree": { + "type": "predicate_form_qualification", + "predicateId": "A0D326D440304DC4B07F12DA6631447F", + "predicateText": "Year (ID) > 2015", + "predicateTree": { + "function": "greater", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "double", + "value": "2015.0" + } + } + ], + "attribute": { + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system", + "name": "ID" + } + } + }, + "tokens": [ + { + "level": "resolved", + "state": "initial", + "value": "%", + "type": "character" + }, + { + "level": "resolved", + "state": "initial", + "value": "Year@ID", + "type": "object_at_form", + "target": { + "dateCreated": "2001-01-02T20:48:10.000Z", + "dateModified": "2012-01-27T12:00:32.000Z", + "versionId": "24CEEC7044C6C7008EE0DF96565E9459", + "primaryLocale": "en-US", + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "attributeForm": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5" + } + }, + { + "level": "resolved", + "state": "initial", + "value": ">", + "type": "character", + "target": { + "dateCreated": "2001-01-02T20:47:41.000Z", + "dateModified": "2018-01-29T21:13:06.000Z", + "versionId": "332E00E411E8053925F00080EF7500C5", + "primaryLocale": "en-US", + "objectId": "8107C317DD9911D3B98100C04F2233EA", + "subType": "function", + "name": ">", + "description": "Returns TRUE if the first value is greater than the second value." + } + }, + { + "level": "resolved", + "state": "initial", + "value": "2015.0", + "type": "integer" + }, + { + "level": "resolved", + "state": "initial", + "value": "", + "type": "end_of_text" + } + ] + }, + "topLevel": [], + "bottomLevel": [] +} +``` + +### Delete a changeset + +Use [DELETE /api/model/changesets/\{changesetId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Changesets/ms-deleteChangeset). + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "pisu5dkkutqfblaamdomgr00ch" +"X-MSTR-MS-Changeset": "0E9F01172ECF4BA2BB510F7B9FB4F6E8" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X DELETE "https://demo.cloud.microstrategy.com/MicroStrategyLibrary/api/model/changesets/0E9F01172ECF4BA2BB510F7B9FB4F6E8" -H "accept: */*" -H "X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch" -H "X-MSTR-MS-Changeset: 0E9F01172ECF4BA2BB510F7B9FB4F6E8" +``` + +Sample Response Body: Empty + +Sample Response Code: 204 (The changeset has been deleted successfully) diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filters-member-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filters-member-in-data-model.md new file mode 100644 index 00000000..5b88d196 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filters-member-in-data-model.md @@ -0,0 +1,77 @@ +--- +title: Retrieve a security filter's member in data model +sidebar_label: Retrieve a security filter's member in data model +description: This workflow sample demonstrates how to get the users and user groups that the specified security filter in data model is applied to. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +This workflow sample demonstrates how to get the users and user groups to which the specified security filter in the data model applies. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. The object ID of the security filter is `8981A1EB828F4888959C0C0A435870CC`. + +:::info + +To get the authorization token needed to execute the request, use [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +To retrieve the security filter's member, use [GET /api/dataModels/\{dataModelId}/securityFilters/\{id}/members](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/getSecurityFilterUsers). + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "4bb7n1dhjo860e7tlpchg57hl" +"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X GET "https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters/8981A1EB828F4888959C0C0A435870CC/members" -H "accept: application/json" -H "X-MSTR-AuthToken: 4bb7n1dhjo860e7tlpchg57hl" -H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Response Body: + +You can view the data model's security filter's members in the response body. + +```json +{ + "users": [ + { + "name": "Katharine Shearn", + "id": "E96A79E011D4BBCE10004694316DE8A4", + "type": 34, + "abbreviation": "kshearn", + "subtype": 8704, + "dateCreated": "2001-01-02T20:42:34.000+0000", + "dateModified": "2019-12-04T16:53:47.000+0000", + "version": "A3930CAE11EA16B600000080EF359083", + "acg": 255, + "owner": { + "name": "Administrator", + "id": "54F3D26011D2896560009A8E67019608" + }, + "extType": 0, + "username": "kshearn", + "fullName": "Katharine Shearn", + "initials": "KS" + } + ], + "totalUsers": 1, + "totalUserGroups": 0 +} +``` + +Response Code 200: (The security filter's member is returned successfully.) diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-all-security-filters-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-all-security-filters-in-data-model.md new file mode 100644 index 00000000..38f8aa59 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-all-security-filters-in-data-model.md @@ -0,0 +1,186 @@ +--- +title: Retrieve all security filters in data model +sidebar_label: Retrieve all security filters in data model +description: This topic covers several workflows for retrieving all security filters in data model. +--- + + + +This topic covers several workflows to retrieve all security filters in a data model. + +- [Retrieve all security filters in data model within a changeset](#retrieve-all-security-filters-in-data-model-within-a-changeset) +- [Retrieve all security filters with users info in data model](#retrieve-all-security-filters-with-users-info-in-data-model) + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +## Retrieve all security filters in data model within a changeset + +You can retrieve all security filters in a data model using a changeset. + +1. Create a changeset using `POST /api/model/changesets` +1. [Retrieve all security filters in data model using `GET /api/model/dataModels/{dataModelId}/securityFilters`](#retrieve-all-security-filters-in-data-model-using-get-apimodeldatamodelsdatamodelidsecurityfilters) +1. Delete the changeset using `DELETE /api/model/changesets/{changesetId}` + +In this workflow sample, you want to retrieve all security filters in a data model. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. + +:::info + +Get the authorization token needed to execute the request with [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +Changesets are used in this workflow. For information on how to create and use changesets, see [Changesets](/docs/common-workflows/modeling/changesets.md). + +### Retrieve all security filters in data model using [GET /api/model/dataModels/\{dataModelId}/securityFilters](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/ms-getDataModelSecurityFilters) + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "frbicqfk7btoggg5bnu450hrqt" +"X-MSTR-MS-Changeset": "C4F6B0E4C87F46EF9B6C5690DFFF87C1" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X GET "https://demo.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters" -H "accept: application/json" -H "X-MSTR-AuthToken: pisu5dkkutqfblaamdomgr00ch" -H "X-MSTR-MS-Changeset: C4F6B0E4C87F46EF9B6C5690DFFF87C1" +``` + +Sample Response Body: + +```json +{ + "offset": 0, + "limit": -1, + "total": 1, + "securityFilters": [ + { + "information": { + "dateCreated": "2025-08-11T07:37:35.858Z", + "dateModified": "2025-08-11T07:37:35.858Z", + "versionId": "88DF4A68957941EBBBC69B975B2D011F", + "primaryLocale": "en-US", + "objectId": "8981A1EB828F4888959C0C0A435870CC", + "subType": "md_security_filter", + "name": "Year > 2015" + }, + "qualification": { + "text": "Year (ID) > 2015", + "tree": { + "type": "predicate_form_qualification", + "predicateId": "62EE53C755F64508BAEE99989E9EACCC", + "predicateText": "Year (ID) > 2015", + "predicateTree": { + "function": "greater", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "double", + "value": "2015.0" + } + } + ], + "attribute": { + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system", + "name": "ID" + } + } + } + }, + "topLevel": [], + "bottomLevel": [] + } + ] +} +``` + +Response Code: 200 (All security filters in data model were returned successfully.) + +## Retrieve all security filters with users info in data model + +Use [GET /api/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/getDataModelSecurityFilters). + +:::info + +To get the authorization token needed to execute the request, use [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "4bb7n1dhjo860e7tlpchg57hl" +"X-MSTR-ProjectID": "B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Request Body: Empty + +Sample Curl: + +```bash +curl -X GET "https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters" -H "accept: application/json" -H "X-MSTR-AuthToken: 4bb7n1dhjo860e7tlpchg57hl" -H "X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754" +``` + +Sample Response Body: + +You can view the security filter's definition in the response body. + +```json +{ + "securityFilters": [ + { + "id": "8981A1EB828F4888959C0C0A435870CC", + "name": "Year > 2015", + "description": "", + "dateCreated": "2025-08-11T07:37:35.858Z", + "dateModified": "2025-08-11T07:37:35.858Z", + "users": [ + { + "name": "Katharine Shearn", + "id": "E96A79E011D4BBCE10004694316DE8A4", + "type": 34, + "abbreviation": "kshearn", + "subtype": 8704, + "dateCreated": "2001-01-02T20:42:34.000+0000", + "dateModified": "2019-12-04T16:53:47.000+0000", + "version": "A3930CAE11EA16B600000080EF359083", + "acg": 255, + "owner": { + "name": "Administrator", + "id": "54F3D26011D2896560009A8E67019608" + }, + "extType": 0, + "username": "kshearn", + "fullName": "Katharine Shearn", + "initials": "KS" + } + ], + "totalUsers": 1, + "totalUserGroups": 0 + } + ] +} +``` + +Response Code: 200 (All security filters in data model were returned successfully, as well as the users info.) diff --git a/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/update-a-security-filter-object-in-data-model.md b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/update-a-security-filter-object-in-data-model.md new file mode 100644 index 00000000..da745b02 --- /dev/null +++ b/docs/common-workflows/mosaic/manage-data-model-security-filter-objects/update-a-security-filter-object-in-data-model.md @@ -0,0 +1,139 @@ +--- +title: Update a security filter object in data model +sidebar_label: Update a security filter object in data model +description: This workflow sample demonstrates how to update a security filter object in data model through the Modeling service. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +This workflow sample demonstrates how to update a security filter definition in a data model using the Modeling service. + +1. Create a changeset using `POST /api/model/changesets` +1. [Update the security filter's definition in data model using `PUT /api/model/dataModels/{dataModelId}/securityFilters/{securityFilterId}`](#update-the-security-filters-definition-in-data-model-using-put-apimodeldatamodelsdatamodelidsecurityfilterssecurityfilterid) +1. Commit the changeset using `POST /api/model/changesets/{changesetId}/commit` +1. Delete the changeset using `DELETE /api/model/changesets/{changesetId}` + +In this workflow example, you want to update the definition of the `"Year > 2015"` security filter object with a new definition of `"Year@ID > 2020"` and a new object name of `"Year > 2020"`. The data model ID is `7F071F619BE244C7B6CDC2626EBB1C6C`. The object ID of the security filter is `8981A1EB828F4888959C0C0A435870CC`. + +:::info + +To get the authorization token needed to execute the request, use [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin). + +Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1). + +::: + +Changesets are used in this workflow. For information on how to create and use changesets, see [Changesets](/docs/common-workflows/modeling/changesets.md). + +## Update the security filter's definition in data model using [PUT /api/model/dataModels/\{dataModelId}/securityFilters/\{securityFilterId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/ms-putDataModelSecurityFilter) + +Sample Request Header: + +```http +"accept": "application/json" +"X-MSTR-AuthToken": "frbicqfk7btoggg5bnu450hrqt" +"X-MSTR-MS-Changeset": "C4F6B0E4C87F46EF9B6C5690DFFF87C1" +``` + +Sample Request Body: + +```json +{ + "information": { + "name": "Year > 2020" + }, + "qualification": { + "tree": { + "type": "predicate_form_qualification", + "predicateTree": { + "function": "greater", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "double", + "value": "2020" + } + } + ], + "attribute": { + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system", + "name": "ID" + } + } + } + } +} +``` + +Sample Curl: + +```bash +curl -X PUT "https://demo.cloud.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/7F071F619BE244C7B6CDC2626EBB1C6C/securityFilters/8981A1EB828F4888959C0C0A435870CC" -H "accept: application/json" -H "X-MSTR-AuthToken: frbicqfk7btoggg5bnu450hrqt" -H "X-MSTR-MS-Changeset: C4F6B0E4C87F46EF9B6C5690DFFF87C1" -H "Content-Type: application/json" -d '{"information":{"name":"Year > 2020"},"qualification":{"tree":{"type":"predicate_form_qualification","predicateTree":{"function":"greater","parameters":[{"parameterType":"constant","constant":{"type":"double","value":"2020"}}],"attribute":{"objectId":"8D679D5111D3E4981000E787EC6DE8A4","subType":"attribute","name":"Year"},"form":{"objectId":"45C11FA478E745FEA08D781CEA190FE5","subType":"attribute_form_system","name":"ID"}}}}}' +``` + +Sample Response Body: + +You can view the data model's security filter's definition in the response body. + +```json +{ + "information": { + "dateCreated": "2025-08-11T07:37:35.858Z", + "dateModified": "2025-08-11T07:43:23.784Z", + "versionId": "C3945CBF4048805AD0F397B6DF3E3DA6", + "primaryLocale": "en-US", + "objectId": "8981A1EB828F4888959C0C0A435870CC", + "subType": "md_security_filter", + "name": "Year > 2020" + }, + "qualification": { + "text": "Year (ID) > 2020", + "tree": { + "type": "predicate_form_qualification", + "predicateId": "89AECC7DAB354B4A933E83E33928C670", + "predicateText": "Year (ID) > 2020", + "predicateTree": { + "function": "greater", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "double", + "value": "2020.0" + } + } + ], + "attribute": { + "objectId": "8D679D5111D3E4981000E787EC6DE8A4", + "subType": "attribute", + "name": "Year" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system", + "name": "ID" + } + } + } + }, + "topLevel": [], + "bottomLevel": [] +} +``` + +Response Code: 200 (The data model's security filter's definition is updated successfully in the changeset.) diff --git a/docs/common-workflows/mosaic/mosaic.md b/docs/common-workflows/mosaic/mosaic.md new file mode 100644 index 00000000..9c319327 --- /dev/null +++ b/docs/common-workflows/mosaic/mosaic.md @@ -0,0 +1,8 @@ +--- +title: Mosaic +description: This section contains workflows that utilize the REST API to handle Mosaic data model related workflows. +--- + + + +This section contains workflows that utilize the REST API to handle Mosaic data model related workflows. diff --git a/docs/common-workflows/mosaic/publish/manage-data-model-publish.md b/docs/common-workflows/mosaic/publish/manage-data-model-publish.md new file mode 100644 index 00000000..3e990276 --- /dev/null +++ b/docs/common-workflows/mosaic/publish/manage-data-model-publish.md @@ -0,0 +1,19 @@ +--- +title: Publish data models +description: You can use REST API requests to publish data models. +--- + + + +:::tip + +You can try these workflows with [REST API Playground](https://www.postman.com/microstrategysdk/microstrategy-rest-api/collection/5aq5sem/strategy-rest-api-workflows). + +Learn more about Strategy REST API Playground [here](/docs/getting-started/playground.md). + +::: + +You can use REST API requests to publish data models. + +- [Refresh a Data Model](refresh-a-data-model.md) +- [Schedule Refresh a Data Model](schedule-refresh-a-data-model.md) diff --git a/docs/common-workflows/mosaic/publish/refresh-a-data-model.md b/docs/common-workflows/mosaic/publish/refresh-a-data-model.md new file mode 100644 index 00000000..a1ffcaba --- /dev/null +++ b/docs/common-workflows/mosaic/publish/refresh-a-data-model.md @@ -0,0 +1,304 @@ +--- +title: Refresh a data model +description: This workflow demonstrates how to refresh a data model using REST API. +--- + + + +This workflow sample demonstrates how to refresh a data model by creating a data model instance and publish it using the REST API. + +- [Log in](#log-in) +- [Create data model instance](#create-data-model-instance) +- [Get tables in the data model](#get-tables-in-the-data-model) +- [Publish](#publish) +- [Get publish status](#get-publish-status) +- [Delete data model instance](#delete-data-model-instance) + +A detailed description of each step of this workflow is listed below. + +## Log in + +Endpoint: [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +``` + +- Request Body + +```json +{ + "loginMode": 1, + "username": "administrator", + "password": "" +} +``` + +- Curl + +```bash +curl -X POST -i -c ~/cookie-jar.txt --header 'Content-Type: application/json'\ +--header 'Accept: application/json' -d '{ +"loginMode":1, +"username": "administrator", +"password": "" +}' https://demo.microstrategy.com/MicroStrategyLibrary/api/auth/login' +``` + +Sample Response + +- Response Headers + +```json +{ + "pragma": "no-cache", + "x-mstr-authtoken": "nllmm5lpmkjdsj4d4etgdikc6c", + "cache-control": "no-cache, no-store, max-age=0, must-revalidate", + "date": "Wed, 16 Aug 2017 01:42:31 GMT", + "expires": "0", + "content-type": null +} +``` + +The authorization token "`x-mstr-authtoken`" returns in the response header. It is used in other endpoints to authenticate the user. + +- Response Body: Empty + +- Response Code: 204 (Success: No Content) + +## Create data model instance + +Before you can publish a data model, you need to create a data model instance. + +Endpoint: [POST /api/dataModels/\{dataModelId}/instances](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/createDataModelInstance) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: pgho7427r1e6p0tem7e677jivk' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +- Curl + +```bash +curl --location --request POST 'https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/9F4772B837604551B4D3CC916ADC5598/instances' --header 'X-MSTR-AuthToken: 2pgjiac8mvb7n4jfrj1ch6gok4' --header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +Sample Response + +- Response Headers + +```http +'X-MSTR-DataModelInstanceId: CBE2C87449CEFFF7C089AEA0EE6BBA9C' +``` + +The data model instance is returned in the response header. + +- Response Body: Empty + +- Response Code: 204 (Success: No Content) + +## Get tables in the data model + +You need to retrieve tables in the data model, as table IDs need to be specified in the request body of publish API. Select the tables that you want to refresh and define the refresh policy for each table. You can use query parameters, such as `offset` and `limit`, to control the pagination of tables returned in the response. + +Endpoint: GET /api/model/dataModels/\{dataModelId}/tables + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: pgho7427r1e6p0tem7e677jivk' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +- Request Body: Empty + +- Curl + +```bash +curl --location 'https://demo.microstrategy.com/MicroStrategyLibrary/api/model/dataModels/9F4772B837604551B4D3CC916ADC5598/tables?offset=0&limit=-1' \ +--header 'X-MSTR-AuthToken: 2pgjiac8mvb7n4jfrj1ch6gok4' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +--header 'Content-Type: application/json' +``` + +Sample Response + +- Response Body: + +```json +{ + "offset": 0, + "limit": -1, + "total": 2, + "tables": [ + { + "information": { + "dateCreated": "2025-08-04T01:25:01.671Z", + "dateModified": "2025-08-04T02:20:51.363Z", + "versionId": "B754E270234CDD4B1004E5BF1FB5F4B1", + "acg": 255, + "primaryLocale": "en-US", + "objectId": "B8A627B44A7A421C81741B868401E446", + "subType": "logical_table", + "name": "ytd_day" + } + }, + { + "information": { + "dateCreated": "2025-08-04T01:25:01.671Z", + "dateModified": "2025-08-04T02:20:51.363Z", + "versionId": "D7A6DE2C594782F4EB98E18BC6A28F75", + "acg": 255, + "primaryLocale": "en-US", + "objectId": "612801B773AF4EFD974FF1F54FFAFB32", + "subType": "logical_table", + "name": "city_mnth_sls" + } + } + ] +} +``` + +- Response Code: 200 (Success: OK) + +## Publish + +Now you can publish the data model with the newly created data model instance. The data model refresh settings are included in the request body, which specifies the refresh policy for each table in the data model. The refresh policy can be 'replace', 'add', 'update', or 'upsert'. + +Endpoint: [POST /api/dataModels/\{dataModelId}/publish](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/publishDataModel) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: pgho7427r1e6p0tem7e677jivk' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +'X-MSTR-DataModelInstanceId: CBE2C87449CEFFF7C089AEA0EE6BBA9C' +``` + +- Request Body + +```json +{ + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "replace" + } + ] +} +``` + +- Curl + +```bash +curl --location 'https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/9F4772B837604551B4D3CC916ADC5598/publish' \ +--header 'X-MSTR-AuthToken: 2pgjiac8mvb7n4jfrj1ch6gok4' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +--header 'X-MSTR-DataModelInstanceId: CBE2C87449CEFFF7C089AEA0EE6BBA9C' \ +--header 'Content-Type: application/json' \ +--data '{ + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "replace" + } + ] +}' +``` + +Sample Response + +- Response Headers + +- Response Body: Empty + +- Response Code: 204 (Success: No Content) + +## Get publish status + +It may take some time for the data model to be published. To check the status of the publish operation, use the following endpoint. + +Endpoint: [GET /api/dataModels/\{dataModelId}/publishStatus](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/pollPublishStatus) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: pgho7427r1e6p0tem7e677jivk' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +'X-MSTR-DataModelInstanceId: CBE2C87449CEFFF7C089AEA0EE6BBA9C' +``` + +- Curl + +```bash +curl --location 'https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/9F4772B837604551B4D3CC916ADC5598/publishStatus' \ +--header 'X-MSTR-AuthToken: 2pgjiac8mvb7n4jfrj1ch6gok4' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +--header 'X-MSTR-DataModelInstanceId: CBE2C87449CEFFF7C089AEA0EE6BBA9C' +``` + +Sample Response + +- Response Body: + +```json +{ + "status": 1 +} +``` + +- Response Code: 200 (Success: OK) + +## Delete data model instance + +After the data model is published, you can delete the data model instance if it is no longer needed. + +Endpoint: [DELETE /api/dataModels/\{dataModelId}/instances/\{instanceId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Data%20Model/deleteDataModelInstance) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: pgho7427r1e6p0tem7e677jivk' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +- Curl + +```bash +curl --location --request DELETE 'https://demo.microstrategy.com/MicroStrategyLibrary/api/dataModels/9F4772B837604551B4D3CC916ADC5598/instances/CBE2C87449CEFFF7C089AEA0EE6BBA9C' \ +--header 'X-MSTR-AuthToken: 2pgjiac8mvb7n4jfrj1ch6gok4' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +Sample Response + +- Response Body: Empty + +- Response Code: 204 (Success: No Content) diff --git a/docs/common-workflows/mosaic/publish/schedule-refresh-a-data-model.md b/docs/common-workflows/mosaic/publish/schedule-refresh-a-data-model.md new file mode 100644 index 00000000..de480bbb --- /dev/null +++ b/docs/common-workflows/mosaic/publish/schedule-refresh-a-data-model.md @@ -0,0 +1,673 @@ +--- +title: Schedule refresh a data model +description: This workflow demonstrates how to schedule a refresh for a data model. +--- + + + +This workflow sample demonstrates how to schedule a refresh for a data model using the REST API. + +- [Log in](#log-in) +- [Get all subscriptions](#get-all-subscriptions) +- [Create a subscription](#create-a-subscription) +- [Update a subscription](#update-a-subscription) +- [Get a subscription by ID](#get-a-subscription-by-id) + +A detailed description of each step of this workflow is listed below. + +## Log in + +Endpoint: [POST /api/auth/login](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Authentication/postLogin) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +``` + +- Request Body + +```json +{ + "loginMode": 1, + "username": "administrator", + "password": "" +} +``` + +- Curl + +```bash +curl -X POST -i -c ~/cookie-jar.txt --header 'Content-Type: application/json'\ +--header 'Accept: application/json' -d '{ +"loginMode":1, +"username": "administrator", +"password": "" +}' https://demo.microstrategy.com/MicroStrategyLibrary/api/auth/login' +``` + +Sample Response + +- Response Headers + +```json +{ + "pragma": "no-cache", + "x-mstr-authtoken": "nllmm5lpmkjdsj4d4etgdikc6c", + "cache-control": "no-cache, no-store, max-age=0, must-revalidate", + "date": "Wed, 16 Aug 2017 01:42:31 GMT", + "expires": "0", + "content-type": null +} +``` + +The authorization token "`x-mstr-authtoken`" is returned in the response header. It is used in other endpoints to authenticate the user. + +- Response Body: Empty + +- Response Code: 204 (Success: No Content) + +## Get all subscriptions + +To retrieve all subscriptions within a project, use the following endpoint. `offset` and `limit` parameters can be used for pagination. For example, if you want to retrieve the first 10 subscriptions, you can set `offset=0` and `limit=10` in the request. + +Endpoint: [GET /api/subscriptions](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Subscriptions/getSubscriptions) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: nllmm5lpmkjdsj4d4etgdikc6c' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +- Curl + +```bash +curl --location 'https://demo.microstrategy.com/MicroStrategyLibrary/api/subscriptions?offset=0&limit=10' \ +--header 'Accept: application/json' \ +--header 'X-MSTR-AuthToken: nllmm5lpmkjdsj4d4etgdikc6c' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +``` + +Sample Response + +- Response Body: + +```json +{ + "subscriptions": [ + { + "name": "Updated Subscription", + "id": "0730C69A4EBAA20BD967EA86274F0C2F", + "multipleContents": false, + "editable": true, + "allowDeliveryChanges": false, + "allowPersonalizationChanges": false, + "allowUnsubscribe": false, + "allowUnsubscribeFromEmail": false, + "dateCreated": "2025-07-29T05:48:30+0000", + "dateModified": "2025-07-29T05:52:37+0000", + "owner": { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator" + }, + "schedules": [ + { + "id": "E24F501E802911E1BBCB892C4924019B", + "name": "Personal View", + "type": "event_based", + "expired": true + } + ], + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "name": "_test api", + "type": "data_model", + "projectId": "B7CA92F04B9FAE8D941C3E9B7E0CD754" + } + ], + "recipients": [ + { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator", + "isGroup": false, + "type": "user", + "includeType": "TO", + "childSubscriptionId": "2A3D6DFB4FE66AF22B228E89DCE4847D" + } + ], + "delivery": { + "mode": "HISTORY_LIST", + "contactSecurity": false, + "historyList": { + "doNotCreateUpdateCaches": false, + "overwriteOlderVersion": false, + "reRunHl": false + }, + "notificationEnabled": false + }, + "alert": false + } + ] +} +``` + +- Response Code: 200 (Success: OK) + +## Create a subscription + +To schedule a refresh for a data model, create a subscription. In the `contents` section of the request body, you need to specify the type as `data_model`. + +Endpoint: [POST /api/subscriptions](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Subscriptions/createSubscription) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: ot5sr2resn9jjjm3fo30lch2lq' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +- Request Body + +```json +{ + "name": "Data Model Subscription Example", + "allowDeliveryChanges": false, + "allowPersonalizationChanges": false, + "allowUnsubscribe": false, + "sendNow": false, + "schedules": [ + { + "id": "FF7BB3C811D501F0C00051916B98494F" + } + ], + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "type": "data_model", + "refreshCondition": { + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "delivery": { + "mode": "HISTORY_LIST" + } +} +``` + +Strategy supports attribute form qualification in the `refreshCondition.filters` section. Refer to the qualification field in [Attribute form qualifications](https://microstrategy.github.io/rest-api-docs/common-workflows/modeling/manage-filter-objects/create-a-filter-object/#attribute-form-qualifications) to create your own filter expression." See the following example request body: + +- Request Body + +```json +{ + "name": "Data Model Subscription Example", + "allowDeliveryChanges": false, + "allowPersonalizationChanges": false, + "allowUnsubscribe": false, + "sendNow": false, + "schedules": [ + { + "id": "FF7BB3C811D501F0C00051916B98494F" + } + ], + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "type": "data_model", + "refreshCondition": { + "filters": [ + { + "type": "refresh", + "qualification": { + "tree": { + "type": "predicate_form_qualification", + "predicateTree": { + "function": "equals", + "parameters": [ + { + "parameterType": "constant", + "constant": { + "type": "string", + "value": "jan" + } + } + ], + "attribute": { + "objectId": "74BA634076BE435F913BA476BFEA2E9B", + "subType": "attribute" + }, + "form": { + "objectId": "45C11FA478E745FEA08D781CEA190FE5", + "subType": "attribute_form_system" + }, + "dataLocale": "en-US" + } + } + } + } + ], + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "delivery": { + "mode": "HISTORY_LIST" + } +} +``` + +- Curl + +```bash +curl --location 'https://demo.microstrategy.com/MicroStrategyLibrary/api/subscriptions/' \ +--header 'Accept: application/json' \ +--header 'X-MSTR-AuthToken: ot5sr2resn9jjjm3fo30lch2lq' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +--header 'Content-Type: application/json' \ +--data '{ + "name": "Data Model Subscription Example", + "allowDeliveryChanges": false, + "allowPersonalizationChanges": false, + "allowUnsubscribe": false, + "sendNow": false, + "schedules": [ + { + "id": "FF7BB3C811D501F0C00051916B98494F" + } + ], + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "type": "data_model", + "refreshCondition": { + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "delivery": { + "mode": "HISTORY_LIST" + } +}' +``` + +Sample Response + +- Response Body: + +```json +{ + "name": "Data Model Subscription Example", + "id": "0730C69A4EBAA20BD967EA86274F0C2F", + "multipleContents": false, + "editable": true, + "allowDeliveryChanges": false, + "allowPersonalizationChanges": false, + "allowUnsubscribe": false, + "allowUnsubscribeFromEmail": false, + "dateCreated": "2025-07-29T05:48:30+0000", + "dateModified": "2025-07-29T05:48:30+0000", + "owner": { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator" + }, + "schedules": [ + { + "id": "FF7BB3C811D501F0C00051916B98494F", + "name": "All the Time", + "type": "time_based", + "nextDelivery": "2025-07-29T06:00:00+0000", + "expired": false + } + ], + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "name": "_test api", + "type": "data_model", + "projectId": "B7CA92F04B9FAE8D941C3E9B7E0CD754", + "refreshCondition": { + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "recipients": [ + { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator", + "isGroup": false, + "type": "user", + "includeType": "TO", + "childSubscriptionId": "2A3D6DFB4FE66AF22B228E89DCE4847D" + } + ], + "delivery": { + "mode": "HISTORY_LIST", + "contactSecurity": false, + "historyList": { + "doNotCreateUpdateCaches": false, + "overwriteOlderVersion": false, + "reRunHl": false + }, + "notificationEnabled": false + }, + "nextDelivery": "2025-07-29T06:00:00+0000", + "alert": false +} +``` + +- Response Code: 201 (Success: Created) + +## Update a subscription + +To update an existing subscription, send a PUT request to the subscription endpoint with the updated details. + +Endpoint: [PUT /api/subscriptions/\{subscriptionId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Subscriptions/updateSubscription) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: ot5sr2resn9jjjm3fo30lch2lq' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +- Request Body + +```json +{ + "name": "Updated Subscription", + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "type": "data_model", + "refreshCondition": { + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "schedules": [ + { + "id": "E24F501E802911E1BBCB892C4924019B", + "name": "Personal View", + "type": "unknown" + } + ], + "recipients": [ + { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator", + "isGroup": false, + "type": "user", + "includeType": "TO", + "childSubscriptionId": "7283682811E5CA909DFA0080EFB579EC" + } + ], + "delivery": { + "mode": "HISTORY_LIST", + "historyList": { + "doNotCreateUpdateCaches": false, + "overwriteOlderVersion": true, + "reRunHl": false + } + } +} +``` + +- Curl + +```bash +curl --location --request PUT 'https://demo.microstrategy.com/MicroStrategyLibrary/api/subscriptions/0730C69A4EBAA20BD967EA86274F0C2F' \ +--header 'X-MSTR-AuthToken: ot5sr2resn9jjjm3fo30lch2lq' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +--header 'Content-Type: application/json' \ +--data '{ + "name": "Updated Subscription", + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "type": "data_model", + "refreshCondition": { + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "schedules": [ + { + "id": "E24F501E802911E1BBCB892C4924019B", + "name": "Personal View", + "type": "unknown" + } + ], + "recipients": [ + { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator", + "isGroup": false, + "type": "user", + "includeType": "TO", + "childSubscriptionId": "7283682811E5CA909DFA0080EFB579EC" + } + ], + "delivery": { + "mode": "HISTORY_LIST", + "historyList": { + "doNotCreateUpdateCaches": false, + "overwriteOlderVersion": true, + "reRunHl": false + } + } +}' +``` + +Sample Response + +- Response Body: + +```json +{ + "name": "Updated Subscription", + "id": "0730C69A4EBAA20BD967EA86274F0C2F", + "multipleContents": false, + "editable": true, + "allowDeliveryChanges": false, + "allowPersonalizationChanges": false, + "allowUnsubscribe": false, + "allowUnsubscribeFromEmail": false, + "dateCreated": "2025-07-29T05:48:30+0000", + "dateModified": "2025-07-29T05:52:37+0000", + "owner": { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator" + }, + "schedules": [ + { + "id": "E24F501E802911E1BBCB892C4924019B", + "name": "Personal View", + "type": "event_based", + "expired": true + } + ], + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "name": "_test api", + "type": "data_model", + "projectId": "B7CA92F04B9FAE8D941C3E9B7E0CD754", + "refreshCondition": { + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "recipients": [ + { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator", + "isGroup": false, + "type": "user", + "includeType": "TO", + "childSubscriptionId": "2A3D6DFB4FE66AF22B228E89DCE4847D" + } + ], + "delivery": { + "mode": "HISTORY_LIST", + "contactSecurity": false, + "historyList": { + "doNotCreateUpdateCaches": false, + "overwriteOlderVersion": false, + "reRunHl": false + }, + "notificationEnabled": false + }, + "alert": false +} +``` + +- Response Code: 200 (Success: OK) + +## Get a subscription by ID + +To retrieve a specific subscription by its ID, use the following endpoint. + +Endpoint: [GET /api/subscriptions/\{subscriptionId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Subscriptions/getSubscriptionById) + +Sample Request + +- Request Headers + +```http +'Content-Type: application/json' +'Accept: application/json' +'X-MSTR-AuthToken: ot5sr2resn9jjjm3fo30lch2lq' +'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +- Curl + +```bash +curl --location 'https://demo.microstrategy.com/MicroStrategyLibrary/api/subscriptions/0730C69A4EBAA20BD967EA86274F0C2F' \ +--header 'Accept: application/json' \ +--header 'X-MSTR-AuthToken: ot5sr2resn9jjjm3fo30lch2lq' \ +--header 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +Sample Response + +- Response Body: + +```json +{ + "name": "Updated Subscription", + "id": "0730C69A4EBAA20BD967EA86274F0C2F", + "multipleContents": false, + "editable": true, + "allowDeliveryChanges": false, + "allowPersonalizationChanges": false, + "allowUnsubscribe": false, + "allowUnsubscribeFromEmail": false, + "dateCreated": "2025-07-29T05:48:30+0000", + "dateModified": "2025-07-29T05:52:37+0000", + "owner": { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator" + }, + "schedules": [ + { + "id": "E24F501E802911E1BBCB892C4924019B", + "name": "Personal View", + "type": "event_based", + "expired": true + } + ], + "contents": [ + { + "id": "9F4772B837604551B4D3CC916ADC5598", + "name": "_test api", + "type": "data_model", + "projectId": "B7CA92F04B9FAE8D941C3E9B7E0CD754", + "refreshCondition": { + "tables": [ + { + "id": "0D1436DF3004418086D8BD3FD985EC4A", + "refreshPolicy": "upsert" + } + ] + } + } + ], + "recipients": [ + { + "id": "54F3D26011D2896560009A8E67019608", + "name": "Administrator", + "isGroup": false, + "type": "user", + "includeType": "TO", + "childSubscriptionId": "2A3D6DFB4FE66AF22B228E89DCE4847D" + } + ], + "delivery": { + "mode": "HISTORY_LIST", + "contactSecurity": false, + "historyList": { + "doNotCreateUpdateCaches": false, + "overwriteOlderVersion": false, + "reRunHl": false + }, + "notificationEnabled": false + }, + "alert": false +} +``` + +- Response Code: 200 (Success: OK) diff --git a/docs/whats-new.md b/docs/whats-new.md index d3e37eca..0568aa1b 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -4,6 +4,21 @@ sidebar_label: What's new Description: What's New in the REST API. --- +## Strategy ONE (August 2025) + +- [Refresh a Data Model](common-workflows/mosaic/publish/refresh-a-data-model.md). +- [Schedule Refresh a Data Model](common-workflows/mosaic/publish/schedule-refresh-a-data-model.md). +- [Create a Security Filter object in a Data Model](common-workflows/mosaic/manage-data-model-security-filter-objects/create-a-security-filter-object-in-data-model.md). +- [Update a Security Filter object in a Data Model](common-workflows/mosaic/manage-data-model-security-filter-objects/update-a-security-filter-object-in-data-model.md). +- [Retrieve a Security Filter Definition in a Data Model](common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filter-definition-in-data-model.md). +- [Retrieve all Security Filters in a Data Model](common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-all-security-filters-in-data-model.md). +- [Retrieve a Security Filter's Member in a Data Model](common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filters-member-in-data-model.md). +- [Modify a Security Filter's Member in a Data Model](common-workflows/mosaic/manage-data-model-security-filter-objects/modify-a-security-filters-member-in-data-model.md). +- [Delete a Security Filter Object in a Data Model](common-workflows/mosaic/manage-data-model-security-filter-objects/delete-a-security-filter-object-in-data-model.md). +- [Retrieve an Attribute's Elements in a Data Model](common-workflows/mosaic/manage-data-model-attribute-objects/retrieve-an-attributes-elements-in-data-model.md). +- [Get ACL of an object in a Data Model](common-workflows/mosaic/manage-data-model-object-acl/retrieve-a-data-model-object-acl.md). +- [Update ACL of an object in a Data Model](common-workflows/mosaic/manage-data-model-object-acl/update-a-data-model-object-acl.md). + ## Strategy ONE (July 2025) - [Project duplication across environments](common-workflows/administration/project-duplication/cross-env-project-duplication.md). Duplicate a project across two environments. diff --git a/sidebars.js b/sidebars.js index a458ed74..daa70480 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1087,6 +1087,68 @@ const sidebars = { }, ], }, + { + type: "category", + label: "Mosaic", + link: { + type: "doc", + id: "common-workflows/mosaic/mosaic", + }, + items: [ + { + type: "category", + label: "Publish data models", + link: { + type: "doc", + id: "common-workflows/mosaic/publish/manage-data-model-publish", + }, + items: [ + "common-workflows/mosaic/publish/refresh-a-data-model", + "common-workflows/mosaic/publish/schedule-refresh-a-data-model", + ], + }, + { + type: "category", + label: "Manage data model security filter objects", + link: { + type: "doc", + id: "common-workflows/mosaic/manage-data-model-security-filter-objects/manage-data-model-security-filter-objects", + }, + items: [ + "common-workflows/mosaic/manage-data-model-security-filter-objects/create-a-security-filter-object-in-data-model", + "common-workflows/mosaic/manage-data-model-security-filter-objects/update-a-security-filter-object-in-data-model", + "common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filter-definition-in-data-model", + "common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-all-security-filters-in-data-model", + "common-workflows/mosaic/manage-data-model-security-filter-objects/retrieve-a-security-filters-member-in-data-model", + "common-workflows/mosaic/manage-data-model-security-filter-objects/modify-a-security-filters-member-in-data-model", + "common-workflows/mosaic/manage-data-model-security-filter-objects/delete-a-security-filter-object-in-data-model", + ], + }, + { + type: "category", + label: "Manage data model attributes objects", + link: { + type: "doc", + id: "common-workflows/mosaic/manage-data-model-attribute-objects/manage-data-model-attribute-objects", + }, + items: [ + "common-workflows/mosaic/manage-data-model-attribute-objects/retrieve-an-attributes-elements-in-data-model", + ], + }, + { + type: "category", + label: "Manage data model object acl", + link: { + type: "doc", + id: "common-workflows/mosaic/manage-data-model-object-acl/manage-data-model-object-acl", + }, + items: [ + "common-workflows/mosaic/manage-data-model-object-acl/retrieve-a-data-model-object-acl", + "common-workflows/mosaic/manage-data-model-object-acl/update-a-data-model-object-acl", + ], + }, + ], + }, ], }, {