Skip to content

Commit 15e8a4c

Browse files
ziyuhehezhe_mstr
andauthored
Update (#62)
* Update * Update --------- Co-authored-by: zhe_mstr <[email protected]>
1 parent 05be7bf commit 15e8a4c

File tree

11 files changed

+486
-25
lines changed

11 files changed

+486
-25
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Bulk deletion of bookmarks
3+
Description: Bulk deletion of bookmarks
4+
---
5+
6+
This workflow sample demostrates how to delete multiple bookmarks at once.
7+
8+
:::info
9+
10+
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).
11+
12+
Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1).
13+
14+
:::
15+
16+
## Bulk deletion of bookmarks
17+
18+
By using this workflow, you can quickly delete multiple bookmarks at once.
19+
20+
### Request URL
21+
22+
```bash
23+
DELETE /api/bookmarks
24+
```
25+
26+
### Request Headers
27+
28+
| Name | Type | Description |
29+
| ------------------ | ------ | ----------------------------------------------------- |
30+
| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login |
31+
| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects |
32+
33+
### Sample Curl Request
34+
35+
```bash
36+
curl -X DELETE 'http://demo.microstrategy.com/MicroStrategyLibrary/api/bookmarks' \
37+
-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \
38+
-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754'
39+
```
40+
41+
### Response
42+
43+
If successful, this request returns a `204` status code.
44+
45+
### HTTP Status Codes
46+
47+
| Status Code | Description |
48+
| ----------- | --------------------- |
49+
| 204 | No Content |
50+
| 500 | Internal Server Error |
51+
| 401 | Unauthorized |
52+
| 400 | Bad Request |
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: Create a bookmark
3+
Description: Create a new bookmark to the current shortcut object.
4+
---
5+
6+
This workflow sample demonstrates how to create a new bookmark to the current shortcut object.
7+
8+
:::tip
9+
10+
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)
11+
12+
:::
13+
14+
:::info
15+
16+
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).
17+
18+
Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1).
19+
20+
:::
21+
22+
## Create a new bookmark
23+
24+
By using this workflow, you can quickly create a new bookmark to the current shortcut object.
25+
26+
### Request URL
27+
28+
```bash
29+
POST /api/bookmarks
30+
```
31+
32+
### Request Headers
33+
34+
| Name | Type | Description |
35+
| ------------------ | ------ | ----------------------------------------------------- |
36+
| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login |
37+
| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects |
38+
39+
### Request body schema
40+
41+
```json
42+
{
43+
"name": "string",
44+
"instanceId": "string"
45+
}
46+
```
47+
48+
- name: Bookmark name
49+
- instanceId: Document shortcut instance ID
50+
51+
**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`.
52+
53+
### Sample Request Body
54+
55+
```json
56+
{
57+
"name": "bookmark sample",
58+
"instanceId": "E697E885F6426C1F0B794593D648AFC0"
59+
}
60+
```
61+
62+
### Sample Curl Request
63+
64+
```bash
65+
curl -X 'POST' 'http://demo.microstrategy.com/MicroStrategyLibrary/api/bookmarks' \
66+
-H 'accept: application/json' \
67+
-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \
68+
-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \
69+
-H 'Content-Type: application/json' \
70+
-d '{
71+
"name": "bookmark sample",
72+
"instanceId": "E697E885F6426C1F0B794593D648AFC0"
73+
}'
74+
```
75+
76+
### Response body schema
77+
78+
If successful, this API call returns a `201 Created` status code and an ID of the bookmark in the response body.
79+
80+
```json
81+
{
82+
"id": "string"
83+
}
84+
```
85+
86+
- id: Bookmark ID
87+
88+
#### sample Response
89+
90+
```json
91+
{
92+
"id": "00000000000000000000000000"
93+
}
94+
```
95+
96+
### HTTP Status Codes
97+
98+
| Status Code | Description |
99+
| ----------- | ------------------------ |
100+
| 201 | Created (See [Location]) |
101+
| 500 | Internal Server Error |
102+
| 401 | Unauthorized |
103+
| 400 | Bad Request |
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Delete a bookmark
3+
Description: Delete a bookmark
4+
---
5+
6+
This workflow sample demonstrates how to delete a bookmark.
7+
8+
:::tip
9+
10+
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)
11+
12+
:::
13+
14+
:::info
15+
16+
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).
17+
18+
Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1).
19+
20+
:::
21+
22+
## Delete a bookmark
23+
24+
By using this workflow, you can quickly delete a bookmark.
25+
26+
### Request URL
27+
28+
```bash
29+
DELETE /api/bookmarks/{id}
30+
```
31+
32+
- id: Bookmark ID
33+
34+
### Request Headers
35+
36+
| Name | Type | Description |
37+
| ------------------ | ------ | ----------------------------------------------------- |
38+
| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login |
39+
| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects |
40+
41+
### Sample Curl Request
42+
43+
```bash
44+
curl -X DELETE 'http://demo.microstrategy.com/MicroStrategyLibrary/api/bookmarks/1F0B794593D648AFC0' \
45+
-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \
46+
-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754'
47+
```
48+
49+
### Response
50+
51+
If successful, this request returns a `204` status code.
52+
53+
### HTTP Status Codes
54+
55+
| Status Code | Description |
56+
| ----------- | --------------------- |
57+
| 204 | No Content |
58+
| 500 | Internal Server Error |
59+
| 401 | Unauthorized |
60+
| 400 | Bad Request |
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
title: Get bookmarks
3+
Description: Get a list of bookmarks from a shortcut object.
4+
---
5+
6+
This workflow sample demonstrates how to get a list of bookmarks from a shortcut object.
7+
8+
:::tip
9+
10+
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)
11+
12+
:::
13+
14+
:::info
15+
16+
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).
17+
18+
Get the project ID from [GET /api/projects](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Projects/getProjects_1).
19+
20+
:::
21+
22+
## Get bookmarks
23+
24+
By using this workflow, you can quickly get a list of bookmarks from a shortcut object.
25+
26+
### Request URL
27+
28+
```bash
29+
GET /api/shortcuts/{shortcutId}/bookmarks
30+
```
31+
32+
- shortcutId: The ID of the document shortcut to execute
33+
34+
**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`.
35+
36+
### Request Headers
37+
38+
| Name | Type | Description |
39+
| ------------------ | ------ | ----------------------------------------------------- |
40+
| `X-MSTR-AuthToken` | Header | Authorization token generated by POST /api/auth/login |
41+
| `X-MSTR-ProjectID` | Header | Project ID generated by GET /api/projects |
42+
43+
### Sample Curl Request
44+
45+
```bash
46+
curl -X GET 'http://demo.microstrategy.com/MicroStrategyLibrary/api/shortcuts/E697E885F6426C1F0B794593D648AFC0/bookmarks' \
47+
-H 'X-MSTR-AuthToken: h979btnpbep63peg8ind69ot79' \
48+
-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754'
49+
```
50+
51+
### Response body schema
52+
53+
If successful, this request returns a `200` status code and a list of bookmarks.
54+
55+
```json
56+
[
57+
{
58+
"id": "string",
59+
"name": "string",
60+
"version": "string",
61+
"creationTime": "string",
62+
"lastUpdateTime": "string",
63+
"lastViewTime": "string",
64+
"href": "string",
65+
"shared": "boolean",
66+
"hidden": "boolean",
67+
"owner": {
68+
"id": "string",
69+
"name": "string",
70+
"expired": "boolean"
71+
}
72+
}
73+
]
74+
```
75+
76+
- id: Bookmark ID
77+
- name: Bookmark name
78+
- version: Bookmark version ID
79+
- creationTime: Bookmark creation time in UTC
80+
- lastUpdateTime: Bookmark last update time in UTC
81+
- lastViewTime: Bookmark last view time in UTC
82+
- href: Relative URL to get bookmark details
83+
- shared: Bookmark has been shared to others
84+
- hidden: Bookmark has been deleted by shared owner
85+
- owner: Bookmark owner details
86+
- id: Owner ID
87+
- name: Owner name
88+
- expired: Owner expired
89+
90+
### Sample response body
91+
92+
```json
93+
[
94+
{
95+
"name": "sample_name",
96+
"id": "sample_id",
97+
"version": "1",
98+
"creationTime": "2024-08-27T07:40:27.194Z",
99+
"lastUpdateTime": "2024-08-27T07:40:27.194Z",
100+
"lastViewTime": "2024-08-27T07:40:27.194Z",
101+
"href": "/relative/url",
102+
"shared": true,
103+
"hidden": true,
104+
"owner": {
105+
"name": "owner_name",
106+
"id": "owner_id",
107+
"expired": true
108+
}
109+
}
110+
]
111+
```
112+
113+
### HTTP Status Codes
114+
115+
| Status Code | Description |
116+
| ----------- | --------------------- |
117+
| 200 | OK |
118+
| 500 | Internal Server Error |
119+
| 401 | Unauthorized |
120+
| 400 | Bad Request |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Manage Bookmarks
3+
Description: Manage bookmarks using the MicroStrategy REST API.
4+
---
5+
6+
You can use REST API requests to manage bookmarks:
7+
8+
- [Add a new bookmark to the current shortcut object](create-bookmark/create-bookmark.md)
9+
- [Bulk deletion of bookmarks](bulk-deletion/bulk-deletion.md)
10+
- [Update a bookmark](update-bookmark/update-bookmark.md)
11+
- [Delete a bookmark](delete-bookmark/delete-bookmark.md)
12+
- [Get a list of bookmarks from a shortcut object](get-bookmarks/get-bookmarks.md)

0 commit comments

Comments
 (0)