- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListIntentsCommand
Get a list of intents that meet the specified criteria.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { LexModelsV2Client, ListIntentsCommand } from "@aws-sdk/client-lex-models-v2"; // ES Modules import
// const { LexModelsV2Client, ListIntentsCommand } = require("@aws-sdk/client-lex-models-v2"); // CommonJS import
const client = new LexModelsV2Client(config);
const input = { // ListIntentsRequest
botId: "STRING_VALUE", // required
botVersion: "STRING_VALUE", // required
localeId: "STRING_VALUE", // required
sortBy: { // IntentSortBy
attribute: "IntentName" || "LastUpdatedDateTime", // required
order: "Ascending" || "Descending", // required
},
filters: [ // IntentFilters
{ // IntentFilter
name: "IntentName", // required
values: [ // FilterValues // required
"STRING_VALUE",
],
operator: "CO" || "EQ", // required
},
],
maxResults: Number("int"),
nextToken: "STRING_VALUE",
};
const command = new ListIntentsCommand(input);
const response = await client.send(command);
// { // ListIntentsResponse
// botId: "STRING_VALUE",
// botVersion: "STRING_VALUE",
// localeId: "STRING_VALUE",
// intentSummaries: [ // IntentSummaryList
// { // IntentSummary
// intentId: "STRING_VALUE",
// intentName: "STRING_VALUE",
// description: "STRING_VALUE",
// parentIntentSignature: "STRING_VALUE",
// inputContexts: [ // InputContextsList
// { // InputContext
// name: "STRING_VALUE", // required
// },
// ],
// outputContexts: [ // OutputContextsList
// { // OutputContext
// name: "STRING_VALUE", // required
// timeToLiveInSeconds: Number("int"), // required
// turnsToLive: Number("int"), // required
// },
// ],
// lastUpdatedDateTime: new Date("TIMESTAMP"),
// },
// ],
// nextToken: "STRING_VALUE",
// };
ListIntentsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
botId Required | string | undefined | The unique identifier of the bot that contains the intent. |
botVersion Required | string | undefined | The version of the bot that contains the intent. |
localeId Required | string | undefined | The identifier of the language and locale of the intents to list. The string must match one of the supported locales. For more information, see Supported languages . |
filters | IntentFilter[] | undefined | Provides the specification of a filter used to limit the intents in the response to only those that match the filter specification. You can only specify one filter and only one string to filter on. |
maxResults | number | undefined | The maximum number of intents to return in each page of results. If there are fewer results than the max page size, only the actual number of results are returned. |
nextToken | string | undefined | If the response from the Use the returned token in the |
sortBy | IntentSortBy | undefined | Determines the sort order for the response from the |
ListIntentsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
botId | string | undefined | The identifier of the bot that contains the intent. |
botVersion | string | undefined | The version of the bot that contains the intent. |
intentSummaries | IntentSummary[] | undefined | Summary information for the intents that meet the filter criteria specified in the request. The length of the list is specified in the |
localeId | string | undefined | The language and locale of the intents in the list. |
nextToken | string | undefined | A token that indicates whether there are more results to return in a response to the |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServerException | server | The service encountered an unexpected condition. Try your request again. |
ServiceQuotaExceededException | client | You have reached a quota for your bot. |
ThrottlingException | client | Your request rate is too high. Reduce the frequency of requests. |
ValidationException | client | One of the input parameters in your request isn't valid. Check the parameters and try your request again. |
LexModelsV2ServiceException | Base exception class for all service exceptions from LexModelsV2 service. |