Skip to main content

Ask a bot instance for suggested questions

Available since MicroStrategy ONE (March 2024)

This workflow sample demonstrates how to ask a bot instance for suggested questions.

info

Obtain the authorization token needed to execute the request using POST /api/auth/login.

Ask a bot instance for suggested questions

Endpoint: POST /api/bots/{botId}/instances/{instanceId}/suggestions

note

Replace {botId} in POST /api/bots/{botId}/instances/{instanceId}/suggestions with the chatbot ID and {instanceId} with your bot instance ID created with POST /api/bots/{botId}/instances in your environment.

Sample Request Body:

{
"count": 1
}

Sample Curl:

curl 'https://demo.microstrategy.com/MicroStrategyLibrary/api/bots/6C6D314E4C881C01BFD79084DD5B2D42/instances/5B1EB48585F04384A97F3D831D7C7416/suggestions' \
-X 'POST'
--header 'X-MSTR-AuthToken: t40ltbk411923ipk85r8r0tace' \
--header 'X-MSTR-ProjectID: FCC1924411EAABC39C6C0080EFA54501' \
--header 'Content-Type: application/json' \
--data '{
"count": 4
}'

Sample Response:

Response CodeStatus
200Successfully return the bot instance's suggested questions
400Error in generating the bot instance's suggested questions
401Authorization failed
404Bot or bot instance does not exist

Sample Response Body on success:

{
"suggestions": [
{
"text": "What is the revenue for year 2023"
}
]
}