Skip to content

Commit 0c50243

Browse files
ziyuhehezhe
andauthored
Update (#66)
Co-authored-by: zhe <[email protected]>
1 parent d620867 commit 0c50243

21 files changed

+1170
-14
lines changed

docs/common-workflows/administration/project-duplication/project-duplication.md

Lines changed: 522 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Next-Gen AI
3+
description: This page contains a summary of REST APIs for the "auto bots" endpoint. You can use REST API requests to interact with Auto Bots.
4+
---
5+
6+
<Available since="Strategy ONE (March 2025)" />
7+
8+
With the release of Strategy ONE (March 2025), we have introduced an enhanced set of APIs designed to leverage the capabilities of Next-Gen AI. These APIs are built on top of the existing question APIs and are compatible with both the Next-Gen AI and the legacy Auto Bots.
9+
10+
The Next-Gen AI APIs provide a seamless way to interact with Next-Gen AI, allowing you to ask questions, retrieve answers, and get historical chat messages from specific bots. Additionally, the APIs offer the ability to get suggested questions, enhancing the user experience by providing relevant queries and answers efficiently.
11+
12+
Starting from Strategy ONE (June 2025), we've added support for retrieving images within answers, allowing for richer, more visual responses from the Next-Gen AI system. This feature includes customizable resolution settings to optimize image quality based on your specific needs.
13+
14+
### Key Features
15+
16+
- **Ask a question to a specific bot**: Submit a question to the specific Auto Bot. This API has been enhanced from the existing question API.
17+
- **Get answer by the question ID**: Retrieve the answer to a specific question using its ID. This API has been enhanced from the existing question API.
18+
- **Get chat history from a specific bot**: Obtain all historical chat messages from a specific bot.
19+
- **Get suggested questions from a specific bot**: Get recommended questions based on the context from a specific bot.
20+
- **Image support in answers**: Request and retrieve images as part of answers from Next-Gen AI, with customizable resolution settings. (Available from Strategy ONE (June 2025))
21+
22+
For further details on how to use these APIs, please refer to the following sections of this manual:
23+
24+
- [Ask a question to a specific bot](./post-question.md)
25+
- [Get answer by the question ID](./get-question-by-id.md)
26+
- [Get chat history from a specific bot](./get-questions-by-bot.md)
27+
- [Get suggested questions from a specific bot](./post-suggestion.md)
28+
- [Get image from an answer](./get-image-of-answer.md)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
sidebar_label: Get an image in the answer of a specific question
3+
title: Get an image in the answer of a specific question
4+
description: This workflow sample demonstrates how to get an image in the answer of a specific question.
5+
---
6+
7+
<Available since="Strategy ONE (June 2024)" />
8+
9+
This workflow sample demonstrates how to get an image in the answer of a specific question.
10+
11+
:::info
12+
13+
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).
14+
15+
:::
16+
17+
## Get an image of an answer related to a question with bot routing
18+
19+
Endpoint: [GET /api/questions/\{questionsId}/answers/images/\{imageId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Next-Gen%20AI/getMessageImage)
20+
21+
:::note
22+
Replace `{questionsId}` in `GET /api/questions/{questionsId}/answers/images/{imageId}` with the question ID from `POST /api/questions` and `{imageId}` with your image ID from `GET /api/questions/{questionId}`.
23+
:::
24+
25+
Sample Curl:
26+
27+
```bash
28+
curl 'https://demo.microstrategy.com/MicroStrategyLibrary/api/questions/862D61DE2EDD4937B31139B7F574E8EE/answers/images/32A0F79BB4374D4792253B38C1177A6D' \
29+
-H 'accept: image/png' \
30+
-H 'X-MSTR-AuthToken: t40ltbk411923ipk85r8r0tace' \
31+
```
32+
33+
Sample Response:
34+
35+
| Response Code | Status |
36+
| ------------- | ------------------------------- |
37+
| 200 | Successfully returned the image |
38+
| 400 | Error in getting the image |
39+
| 401 | Authorization failed |
40+
| 403 | Forbidden |
41+
| 404 | Image not found |
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
sidebar_label: Get answer by the question ID
3+
title: Get answer by the question ID
4+
description: This workflow sample demonstrates how to get a question's answer by the question ID.
5+
---
6+
7+
<Available since="Strategy ONE (March 2025)" />
8+
9+
This workflow sample demonstrates how to get a question's answer by the question ID.
10+
11+
:::info
12+
13+
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).
14+
15+
:::
16+
17+
## Get a question with question ID
18+
19+
Endpoint: [GET /api/questions/\{questionId}](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Next-Gen%20AI/queryMessage_1)
20+
21+
:::note
22+
Replace `{questionId}` in `GET /api/questions/{questionId}` with your question ID from `POST /api/questions`.
23+
:::
24+
25+
Sample Request Body:
26+
No request body.
27+
28+
Sample Curl:
29+
30+
```bash
31+
curl 'https://demo.microstrategy.com/MicroStrategyLibrary/api/questions/9161386651E84054A6230796C84E12C5:68696ADB633946B4B430ABD959433B3B:FCC1C28296014AB19ABD877E60590890' \
32+
-H 'accept: */*' \
33+
-H 'X-MSTR-AuthToken: evvk84kcucn8abon6c1qfbud7' \
34+
```
35+
36+
Sample Response Code:
37+
38+
| Response Code | Status |
39+
| ------------- | ------------------------------------------------------------------------------ |
40+
| 200 | Successfully returned the question from the bot that has been answered |
41+
| 202 | Successfully returned the question from the bot which is still being processed |
42+
| 400 | Error in getting the question from the bot |
43+
| 401 | Authorization failed |
44+
| 404 | Question does not exist |
45+
46+
## Response Body on Success
47+
48+
The response is the question and answer with the specific ID.
49+
50+
### Response when the question is still being processed
51+
52+
If the response code is 202, indicating that the question is still being processed, continue calling this API to check the status of the question.
53+
54+
If the question is being processed, the response is:
55+
56+
```json
57+
{
58+
"id": "9161386651E84054A6230796C84E12C5:68696ADB633946B4B430ABD959433B3B:FCC1C28296014AB19ABD877E60590890",
59+
"text": "Analyze the distribution of cooking times for recipes",
60+
"answers": [],
61+
"creationDate": "2024-03-08T09:01:43.154+0000"
62+
}
63+
```
64+
65+
### Response when all data is ready
66+
67+
If the status code is 200, indicating that the question has been answered.
68+
69+
```json
70+
{
71+
"id": "9161386651E84054A6230796C84E12C5:68696ADB633946B4B430ABD959433B3B:FCC1C28296014AB19ABD877E60590890",
72+
"text": "Analyze the distribution of cooking times for recipes",
73+
"answers": [
74+
{
75+
"bot": { "id": "68696ADB633946B4B430ABD959433B3B" },
76+
"text": "#Title 1\nThe distribution of cooking times for recipes is as follows:\n- The shortest cooking time is -1 minute.\n- The majority of recipes have cooking times ranging from 2 to 60 minutes.\n- There are a few recipes with longer cooking times, such as 75, 90, 120, and 720 minutes.\n- The exact distribution of cooking times can be seen in the visualization result.",
77+
"images": [{ "id": "79FD176AEAD9446395B083B5931E9EC7", "width": 800, "height": 600 }],
78+
"route": "sql"
79+
}
80+
],
81+
"creationDate": "2024-03-08T09:01:43.154+0000"
82+
}
83+
```
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
sidebar_label: Get chat history from a specific bot
3+
title: Get chat history from a specific bot
4+
description: This workflow sample demonstrates how to get the historical chat messages from a specific bot.
5+
---
6+
7+
<Available since="Strategy ONE (March 2025)" />
8+
9+
This API is used to get the historical questions from a specific bot for the current user, which can be used as the `history` parameter in the `Ask a question to a specific bot` API.
10+
11+
:::info
12+
13+
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).
14+
15+
:::
16+
17+
## Get Questions by Bot
18+
19+
Endpoint: [GET /api/questions/](https://demo.microstrategy.com/MicroStrategyLibrary/api-docs/index.html#/Next-Gen%20AI/getChats_1)
20+
21+
Sample Request Headers:
22+
23+
| Header | Required | Description | Sample Value |
24+
| ---------------- | -------- | -------------------------- | -------------------------------- |
25+
| X-MSTR-AuthToken | Yes | Authorization Token | t40ltbk411923ipk85r8r0tace |
26+
| X-MSTR-ProjectID | Yes | Project ID | B7CA92F04B9FAE8D941C3E9B7E0CD754 |
27+
| Content-Type | Yes | Type of content being sent | application/json |
28+
29+
Sample Request Query Strings:
30+
31+
| Query String | Required | Description | Sample Value |
32+
| ------------ | -------- | ---------------------------------------------------------- | -------------------------------- |
33+
| botId | Yes | The ID of the bot whose chat history you want to retrieve. | 065B007500614D158B41B0D020C96966 |
34+
35+
Sample Curl:
36+
37+
```bash
38+
curl 'https://demo.microstrategy.com/MicroStrategyLibrary/api/questions?botId=065B007500614D158B41B0D020C96966' \
39+
-H 'accept: */*' \
40+
-H 'X-MSTR-AuthToken: evvk84kcucn8abon6c1qfbud7' \
41+
-H 'X-MSTR-ProjectID: B7CA92F04B9FAE8D941C3E9B7E0CD754' \
42+
```
43+
44+
Sample Response Code:
45+
46+
| Response Code | Status |
47+
| ------------- | ------------------------------------------------ |
48+
| 200 | Successfully returned the questions from the bot |
49+
| 400 | Error in getting the questions from the bot |
50+
| 401 | Authorization failed |
51+
| 404 | Bot does not exist |
52+
53+
## Response Body on Success
54+
55+
The response is a list of questions and answers from the specific bot.
56+
57+
### Sample Response
58+
59+
```json
60+
{
61+
"questions": [
62+
{
63+
"id": "B7CA92F04B9FAE8D941C3E9B7E0CD754:065B007500614D158B41B0D020C96966:1BA14D43628D40ABA5DF6616843C611F",
64+
"text": "Show the revenue in euros per month of the highest-grossing branch in Germany in 2024 in a gid.",
65+
"answers": [
66+
{
67+
"bot": {
68+
"id": "065B007500614D158B41B0D020C96966",
69+
"projectId": "B7CA92F04B9FAE8D941C3E9B7E0CD754"
70+
},
71+
"text": "The highest-grossing branch in Germany in 2024 generated the following revenue in euros per month:\n- August: €11,327,719\n- September: €10,847,290\n- October: €12,609,864\n- November: €13,793,524\n- December: €12,002,767",
72+
"route": "sql"
73+
}
74+
],
75+
"creationDate": "2025-03-06T06:07:47.272+0000",
76+
"snapshot": false,
77+
"type": "snapshots"
78+
},
79+
{
80+
"id": "B7CA92F04B9FAE8D941C3E9B7E0CD754:065B007500614D158B41B0D020C96966:75262B7346CC469EA7B874E49888040E",
81+
"text": "What was the Umsatz in Euro in Kristallhöhle during 2024/10 Okt?",
82+
"answers": [
83+
{
84+
"bot": {
85+
"id": "065B007500614D158B41B0D020C96966",
86+
"projectId": "B7CA92F04B9FAE8D941C3E9B7E0CD754"
87+
},
88+
"text": "Der Gesamtumsatz in Euro (Umsatz in Euro) für die Region 'kristallhöhle' im Oktober 2024 betrug €92.541.045.",
89+
"route": "sql"
90+
}
91+
],
92+
"creationDate": "2025-03-07T02:56:53.708+0000",
93+
"snapshot": false,
94+
"type": "history"
95+
}
96+
]
97+
}
98+
```
99+
100+
:::note
101+
Questions with `type` as `snapshots` should not be used as history in the `Ask a Specific Bot a Question` API.
102+
:::

0 commit comments

Comments
 (0)