diff --git a/docs/common-workflows/administration/manage-bookmarks/bulk-deletion/bulk-deletion.md b/docs/common-workflows/administration/manage-bookmarks/bulk-deletion/bulk-deletion.md new file mode 100644 index 000000000..e979dc945 --- /dev/null +++ b/docs/common-workflows/administration/manage-bookmarks/bulk-deletion/bulk-deletion.md @@ -0,0 +1,52 @@ +--- +title: Bulk deletion of bookmarks +Description: Bulk deletion of bookmarks +--- + +This workflow sample demostrates how to delete multiple bookmarks at once. + +:::info + +Obtain the authorization token needed to execute the request using [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). + +::: + +## Bulk deletion of bookmarks + +By using this workflow, you can quickly delete multiple bookmarks at once. + +### Request URL + +```bash +DELETE /api/bookmarks +``` + +### Request Headers + +| Name | Type | Description | +| ------------------ | ------ | ----------------------------------------------------- | +| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login | +| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects | + +### Sample Curl Request + +```bash +curl -X DELETE 'http://demo.microstrategy.com/MicroStrategyLibrary/api/bookmarks' \ +-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \ +-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +### Response + +If successful, this request returns a `204` status code. + +### HTTP Status Codes + +| Status Code | Description | +| ----------- | --------------------- | +| 204 | No Content | +| 500 | Internal Server Error | +| 401 | Unauthorized | +| 400 | Bad Request | diff --git a/docs/common-workflows/administration/manage-bookmarks/create-bookmark/create-bookmark.md b/docs/common-workflows/administration/manage-bookmarks/create-bookmark/create-bookmark.md new file mode 100644 index 000000000..023c48454 --- /dev/null +++ b/docs/common-workflows/administration/manage-bookmarks/create-bookmark/create-bookmark.md @@ -0,0 +1,103 @@ +--- +title: Create a bookmark +Description: Create a new bookmark to the current shortcut object. +--- + +This workflow sample demonstrates how to create a new bookmark to the current shortcut object. + +:::tip + +You can try out this API with the [REST API Playground](https://www.postman.com/microstrategysdk/workspace/microstrategy-rest-api/request/16131298-c4ea6f55-358d-48b1-b13d-57557430c8ee) + +::: + +:::info + +Obtain the authorization token needed to execute the request using [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). + +::: + +## Create a new bookmark + +By using this workflow, you can quickly create a new bookmark to the current shortcut object. + +### Request URL + +```bash +POST /api/bookmarks +``` + +### Request Headers + +| Name | Type | Description | +| ------------------ | ------ | ----------------------------------------------------- | +| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login | +| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects | + +### Request body schema + +```json +{ + "name": "string", + "instanceId": "string" +} +``` + +- name: Bookmark name +- instanceId: Document shortcut instance ID + +**Note:** You can obtain the document shortcut instance ID from the URL. For example, if you open a dashboard and the URL is `https://demo.microstrategy.com/MicroStrategyLibrary/app/EC70648611E7A2F962E90080EFD58751/316AAC7211EA8303102E0080EFA5E1BA` then the instance ID is `316AAC7211EA8303102E0080EFA5E1BA`. + +### Sample Request Body + +```json +{ + "name": "bookmark sample", + "instanceId": "E697E885F6426C1F0B794593D648AFC0" +} +``` + +### Sample Curl Request + +```bash +curl -X 'POST' 'http://demo.microstrategy.com/MicroStrategyLibrary/api/bookmarks' \ +-H 'accept: application/json' \ +-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \ +-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +-H 'Content-Type: application/json' \ +-d '{ + "name": "bookmark sample", + "instanceId": "E697E885F6426C1F0B794593D648AFC0" +}' +``` + +### Response body schema + +If successful, this API call returns a `201 Created` status code and an ID of the bookmark in the response body. + +```json +{ + "id": "string" +} +``` + +- id: Bookmark ID + +#### sample Response + +```json +{ + "id": "00000000000000000000000000" +} +``` + +### HTTP Status Codes + +| Status Code | Description | +| ----------- | ------------------------ | +| 201 | Created (See [Location]) | +| 500 | Internal Server Error | +| 401 | Unauthorized | +| 400 | Bad Request | diff --git a/docs/common-workflows/administration/manage-bookmarks/delete-bookmark/delete-bookmark.md b/docs/common-workflows/administration/manage-bookmarks/delete-bookmark/delete-bookmark.md new file mode 100644 index 000000000..b254c46ac --- /dev/null +++ b/docs/common-workflows/administration/manage-bookmarks/delete-bookmark/delete-bookmark.md @@ -0,0 +1,60 @@ +--- +title: Delete a bookmark +Description: Delete a bookmark +--- + +This workflow sample demonstrates how to delete a bookmark. + +:::tip + +You can try out this API with the [REST API Playground](https://www.postman.com/microstrategysdk/workspace/microstrategy-rest-api/request/16131298-30c5966a-8fb3-4f5a-b4aa-4c0832e2cc9b) + +::: + +:::info + +Obtain the authorization token needed to execute the request using [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). + +::: + +## Delete a bookmark + +By using this workflow, you can quickly delete a bookmark. + +### Request URL + +```bash +DELETE /api/bookmarks/{id} +``` + +- id: Bookmark ID + +### Request Headers + +| Name | Type | Description | +| ------------------ | ------ | ----------------------------------------------------- | +| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login | +| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects | + +### Sample Curl Request + +```bash +curl -X DELETE 'http://demo.microstrategy.com/MicroStrategyLibrary/api/bookmarks/1F0B794593D648AFC0' \ +-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \ +-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +### Response + +If successful, this request returns a `204` status code. + +### HTTP Status Codes + +| Status Code | Description | +| ----------- | --------------------- | +| 204 | No Content | +| 500 | Internal Server Error | +| 401 | Unauthorized | +| 400 | Bad Request | diff --git a/docs/common-workflows/administration/manage-bookmarks/get-bookmarks/get-bookmarks.md b/docs/common-workflows/administration/manage-bookmarks/get-bookmarks/get-bookmarks.md new file mode 100644 index 000000000..dd86d0ca5 --- /dev/null +++ b/docs/common-workflows/administration/manage-bookmarks/get-bookmarks/get-bookmarks.md @@ -0,0 +1,120 @@ +--- +title: Get bookmarks +Description: Get a list of bookmarks from a shortcut object. +--- + +This workflow sample demonstrates how to get a list of bookmarks from a shortcut object. + +:::tip + +You can try out this API with the [REST API Playground](https://www.postman.com/microstrategysdk/workspace/microstrategy-rest-api/request/16131298-d9b09847-5ef5-42f2-8ab3-3a384c45b8da) + +::: + +:::info + +Obtain the authorization token needed to execute the request using [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). + +::: + +## Get bookmarks + +By using this workflow, you can quickly get a list of bookmarks from a shortcut object. + +### Request URL + +```bash +GET /api/shortcuts/{shortcutId}/bookmarks +``` + +- shortcutId: The ID of the document shortcut to execute + +**Note:** You can obtain the document shortcut instance ID from the URL. For example, if you open a dashboard and the URL is `https://demo.microstrategy.com/MicroStrategyLibrary/app/EC70648611E7A2F962E90080EFD58751/316AAC7211EA8303102E0080EFA5E1BA` then the instance ID is `316AAC7211EA8303102E0080EFA5E1BA`. + +### Request Headers + +| Name | Type | Description | +| ------------------ | ------ | ----------------------------------------------------- | +| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login | +| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects | + +### Sample Curl Request + +```bash +curl -X GET 'http://demo.microstrategy.com/MicroStrategyLibrary/api/shortcuts/E697E885F6426C1F0B794593D648AFC0/bookmarks' \ +-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \ +-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' +``` + +### Response body schema + +If successful, this request returns a `200` status code and a list of bookmarks. + +```json +[ + { + "id": "string", + "name": "string", + "version": "string", + "creationTime": "string", + "lastUpdateTime": "string", + "lastViewTime": "string", + "href": "string", + "shared": "boolean", + "hidden": "boolean", + "owner": { + "id": "string", + "name": "string", + "expired": "boolean" + } + } +] +``` + +- id: Bookmark ID +- name: Bookmark name +- version: Bookmark version ID +- creationTime: Bookmark creation time in UTC +- lastUpdateTime: Bookmark last update time in UTC +- lastViewTime: Bookmark last view time in UTC +- href: Relative URL to get bookmark details +- shared: Bookmark has been shared to others +- hidden: Bookmark has been deleted by shared owner +- owner: Bookmark owner details + - id: Owner ID + - name: Owner name + - expired: Owner expired + +### Sample response body + +```json +[ + { + "name": "sample_name", + "id": "sample_id", + "version": "1", + "creationTime": "2024-08-27T07:40:27.194Z", + "lastUpdateTime": "2024-08-27T07:40:27.194Z", + "lastViewTime": "2024-08-27T07:40:27.194Z", + "href": "/relative/url", + "shared": true, + "hidden": true, + "owner": { + "name": "owner_name", + "id": "owner_id", + "expired": true + } + } +] +``` + +### HTTP Status Codes + +| Status Code | Description | +| ----------- | --------------------- | +| 200 | OK | +| 500 | Internal Server Error | +| 401 | Unauthorized | +| 400 | Bad Request | diff --git a/docs/common-workflows/administration/manage-bookmarks/manage-bookmarks.md b/docs/common-workflows/administration/manage-bookmarks/manage-bookmarks.md new file mode 100644 index 000000000..0418b3a4e --- /dev/null +++ b/docs/common-workflows/administration/manage-bookmarks/manage-bookmarks.md @@ -0,0 +1,12 @@ +--- +title: Manage Bookmarks +Description: Manage bookmarks using the MicroStrategy REST API. +--- + +You can use REST API requests to manage bookmarks: + +- [Add a new bookmark to the current shortcut object](create-bookmark/create-bookmark.md) +- [Bulk deletion of bookmarks](bulk-deletion/bulk-deletion.md) +- [Update a bookmark](update-bookmark/update-bookmark.md) +- [Delete a bookmark](delete-bookmark/delete-bookmark.md) +- [Get a list of bookmarks from a shortcut object](get-bookmarks/get-bookmarks.md) diff --git a/docs/common-workflows/administration/manage-bookmarks/update-bookmark/update-bookmark.md b/docs/common-workflows/administration/manage-bookmarks/update-bookmark/update-bookmark.md new file mode 100644 index 000000000..e6e5a320c --- /dev/null +++ b/docs/common-workflows/administration/manage-bookmarks/update-bookmark/update-bookmark.md @@ -0,0 +1,89 @@ +--- +title: Update a bookmark +Description: Update a bookmark +--- + +This workflow sample demonstrates how to update a bookmark. + +:::tip + +You can try out this API with the [REST API Playground](https://www.postman.com/microstrategysdk/workspace/microstrategy-rest-api/request/16131298-e076d557-f027-4cc8-bc7d-7d00bc286ce0) + +::: + +:::info + +Obtain the authorization token needed to execute the request using [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). + +::: + +## Update a bookmark + +By using this workflow, you can quickly update a bookmark. + +### Request URL + +```bash +PUT /api/bookmarks/{id} +``` + +- id: Bookmark ID + +### Request Headers + +| Name | Type | Description | +| ------------------ | ------ | ----------------------------------------------------- | +| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login | +| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects | + +### Request body schema + +```json +{ + "name": "string", + "instanceId": "string" +} +``` + +- name: Bookmark name +- instanceId: Document shortcut instance ID + +**Note:** You can obtain the document shortcut instance ID from the URL. For example, if you open a dashboard and the URL is `https://demo.microstrategy.com/MicroStrategyLibrary/app/EC70648611E7A2F962E90080EFD58751/316AAC7211EA8303102E0080EFA5E1BA` then the instance ID is `316AAC7211EA8303102E0080EFA5E1BA`. + +### Sample Request Body + +```json +{ + "name": "bookmark sample", + "instanceId": "E697E885F6426C1F0B794593D648AFC0" +} +``` + +### Sample Curl Request + +```bash +curl -X 'PUT' 'http://demo.microstrategy.com/MicroStrategyLibrary/api/bookmarks/1F0B794593D648AFC0' \ +-H 'accept: application/json' \ +-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \ +-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \ +-H 'Content-Type: application/json' \ +-d '{ + "name": "bookmark sample", + "instanceId": "E697E885F6426C1F0B794593D648AFC0" +}' +``` + +### Response + +If successful, this request returns a `201` status code. + +### HTTP Status Codes + +| Status Code | Description | +| ----------- | --------------------- | +| 201 | No Content | +| 500 | Internal Server Error | +| 401 | Unauthorized | +| 400 | Bad Request | diff --git a/docs/common-workflows/analytics/question-with-bot-routing-api/ask-question-to-bots-in-the-application.md b/docs/common-workflows/analytics/question-with-bot-routing-api/ask-question-to-bots-in-the-application.md index 8f9670499..c38da92d0 100644 --- a/docs/common-workflows/analytics/question-with-bot-routing-api/ask-question-to-bots-in-the-application.md +++ b/docs/common-workflows/analytics/question-with-bot-routing-api/ask-question-to-bots-in-the-application.md @@ -37,10 +37,11 @@ Sample Request Query Strings: Sample Request Body: -| Field | Required | Description | Sample Value | -| -------------- | -------- | --------------------------------------------------------------------------- | --------------------------------------- | -| text | Yes | The question text | Which customer has the highest revenue? | -| answers.images | No | Optional. If not specified, the image is not generated. Supports one image. | [\{"width": 200, "height": 300\}] | +| Field | Required | Description | Sample Value | +| -------------- | -------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| text | Yes | The question text | Which customer has the highest revenue? | +| answers.images | No | Optional. If not specified, the image is not generated. Supports one image. | [\{"width": 200, "height": 300\}] | +| quotes | No | Optional. The content of the question quote. The type of quotes can be message or answer. | [\{"text":"There are 10000 distinct customers identified based on the purchasing behavior.", "type":"message"\}] | ```json { @@ -50,6 +51,14 @@ Sample Request Body: "width": 720, "height": 405 } + ], + "quotes": [ + { + "id": "24EBB7209BA649B0BACF8DC4A12037E3", + "question": "How many distinct customers are identified based on the purchasing behavior?", + "text": "There are 10000 distinct customers identified based on the purchasing behavior.", + "type": "answer" + } ] } ``` @@ -70,6 +79,14 @@ curl 'https://demo.microstrategy.com/MicroStrategyLibrary/api/questions' \ "width": 720, "height": 405 } + ], + "quotes": [ + { + "id": "24EBB7209BA649B0BACF8DC4A12037E3", + "question": "How many distinct customers are identified based on the purchasing behavior?", + "text": "There are 10000 distinct customers identified based on the purchasing behavior.", + "type": "answer" + } ] }' ``` diff --git a/docs/whats-new.md b/docs/whats-new.md index 5329f3cb1..59600985b 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -4,6 +4,10 @@ sidebar_label: What's new Description: What's New in the REST API. --- +## MicroStrategy ONE (September 2024) + +- [Managing bookmarks](common-workflows/administration/manage-bookmarks/manage-bookmarks.md). Retrieve, create, update, and delete bookmarks. + ## MicroStrategy ONE (June 2024) - [Question with Bot Routing APIs](common-workflows/analytics/question-with-bot-routing-api/question-api.md). Leverage bot routing to ensure user questions are directed to the most appropriate bot with no need to manually switch bots. diff --git a/package.json b/package.json index 2bb1b78bc..a516ad69e 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,9 @@ "shelljs": "^0.8.5", "typescript": "~5.2.2" }, + "resolutions": { + "braces": "3.0.3" + }, "browserslist": { "production": [ ">0.5%", diff --git a/sidebars.js b/sidebars.js index 4bbd2865a..0b90fb9ab 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1041,6 +1041,21 @@ const sidebars = { }, ], }, + { + type: "category", + link: { + type: "doc", + id: "common-workflows/administration/manage-bookmarks/manage-bookmarks", + }, + label: "Manage bookmarks", + items: [ + "common-workflows/administration/manage-bookmarks/create-bookmark/create-bookmark", + "common-workflows/administration/manage-bookmarks/update-bookmark/update-bookmark", + "common-workflows/administration/manage-bookmarks/delete-bookmark/delete-bookmark", + "common-workflows/administration/manage-bookmarks/bulk-deletion/bulk-deletion", + "common-workflows/administration/manage-bookmarks/get-bookmarks/get-bookmarks", + ], + }, ], }, ], diff --git a/yarn.lock b/yarn.lock index e993acace..dbcffa769 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3076,14 +3076,7 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -braces@^3.0.3: +braces@3.0.3, braces@^3.0.2, braces@^3.0.3, braces@~3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== @@ -4746,13 +4739,6 @@ filesize@^8.0.6: resolved "https://registry.yarnpkg.com/filesize/-/filesize-8.0.7.tgz#695e70d80f4e47012c132d57a059e80c6b580bd8" integrity sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ== -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - fill-range@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" @@ -10054,14 +10040,14 @@ write-file-atomic@^3.0.3: typedarray-to-buffer "^3.1.5" ws@^7.3.1: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== ws@^8.13.0: - version "8.17.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.0.tgz#d145d18eca2ed25aaf791a183903f7be5e295fea" - integrity sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow== + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== xdg-basedir@^5.0.1, xdg-basedir@^5.1.0: version "5.1.0"