- 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.
ListSlotsCommand
Gets a list of slots that match the specified criteria.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { LexModelsV2Client, ListSlotsCommand } from "@aws-sdk/client-lex-models-v2"; // ES Modules import
// const { LexModelsV2Client, ListSlotsCommand } = require("@aws-sdk/client-lex-models-v2"); // CommonJS import
const client = new LexModelsV2Client(config);
const input = { // ListSlotsRequest
botId: "STRING_VALUE", // required
botVersion: "STRING_VALUE", // required
localeId: "STRING_VALUE", // required
intentId: "STRING_VALUE", // required
sortBy: { // SlotSortBy
attribute: "SlotName" || "LastUpdatedDateTime", // required
order: "Ascending" || "Descending", // required
},
filters: [ // SlotFilters
{ // SlotFilter
name: "SlotName", // required
values: [ // FilterValues // required
"STRING_VALUE",
],
operator: "CO" || "EQ", // required
},
],
maxResults: Number("int"),
nextToken: "STRING_VALUE",
};
const command = new ListSlotsCommand(input);
const response = await client.send(command);
// { // ListSlotsResponse
// botId: "STRING_VALUE",
// botVersion: "STRING_VALUE",
// localeId: "STRING_VALUE",
// intentId: "STRING_VALUE",
// slotSummaries: [ // SlotSummaryList
// { // SlotSummary
// slotId: "STRING_VALUE",
// slotName: "STRING_VALUE",
// description: "STRING_VALUE",
// slotConstraint: "Required" || "Optional",
// slotTypeId: "STRING_VALUE",
// valueElicitationPromptSpecification: { // PromptSpecification
// messageGroups: [ // MessageGroupsList // required
// { // MessageGroup
// message: { // Message
// plainTextMessage: { // PlainTextMessage
// value: "STRING_VALUE", // required
// },
// customPayload: { // CustomPayload
// value: "STRING_VALUE", // required
// },
// ssmlMessage: { // SSMLMessage
// value: "STRING_VALUE", // required
// },
// imageResponseCard: { // ImageResponseCard
// title: "STRING_VALUE", // required
// subtitle: "STRING_VALUE",
// imageUrl: "STRING_VALUE",
// buttons: [ // ButtonsList
// { // Button
// text: "STRING_VALUE", // required
// value: "STRING_VALUE", // required
// },
// ],
// },
// },
// variations: [ // MessageVariationsList
// {
// plainTextMessage: {
// value: "STRING_VALUE", // required
// },
// customPayload: {
// value: "STRING_VALUE", // required
// },
// ssmlMessage: {
// value: "STRING_VALUE", // required
// },
// imageResponseCard: {
// title: "STRING_VALUE", // required
// subtitle: "STRING_VALUE",
// imageUrl: "STRING_VALUE",
// buttons: [
// {
// text: "STRING_VALUE", // required
// value: "STRING_VALUE", // required
// },
// ],
// },
// },
// ],
// },
// ],
// maxRetries: Number("int"), // required
// allowInterrupt: true || false,
// messageSelectionStrategy: "Random" || "Ordered",
// promptAttemptsSpecification: { // PromptAttemptsSpecificationMap
// "<keys>": { // PromptAttemptSpecification
// allowInterrupt: true || false,
// allowedInputTypes: { // AllowedInputTypes
// allowAudioInput: true || false, // required
// allowDTMFInput: true || false, // required
// },
// audioAndDTMFInputSpecification: { // AudioAndDTMFInputSpecification
// startTimeoutMs: Number("int"), // required
// audioSpecification: { // AudioSpecification
// maxLengthMs: Number("int"), // required
// endTimeoutMs: Number("int"), // required
// },
// dtmfSpecification: { // DTMFSpecification
// maxLength: Number("int"), // required
// endTimeoutMs: Number("int"), // required
// deletionCharacter: "STRING_VALUE", // required
// endCharacter: "STRING_VALUE", // required
// },
// },
// textInputSpecification: { // TextInputSpecification
// startTimeoutMs: Number("int"), // required
// },
// },
// },
// },
// lastUpdatedDateTime: new Date("TIMESTAMP"),
// },
// ],
// nextToken: "STRING_VALUE",
// };
ListSlotsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
botId Required | string | undefined | The identifier of the bot that contains the slot. |
botVersion Required | string | undefined | The version of the bot that contains the slot. |
intentId Required | string | undefined | The unique identifier of the intent that contains the slot. |
localeId Required | string | undefined | The identifier of the language and locale of the slots to list. The string must match one of the supported locales. For more information, see Supported languages . |
filters | SlotFilter[] | undefined | Provides the specification of a filter used to limit the slots 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 slots 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 |
sortBy | SlotSortBy | undefined | Determines the sort order for the response from the |
ListSlotsCommand 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 slots. |
botVersion | string | undefined | The version of the bot that contains the slots. |
intentId | string | undefined | The identifier of the intent that contains the slots. |
localeId | string | undefined | The language and locale of the slots in the list. |
nextToken | string | undefined | A token that indicates whether there are more results to return in a response to the |
slotSummaries | SlotSummary[] | undefined | Summary information for the slots that meet the filter criteria specified in the request. The length of the list is specified in 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. |