GetBotChannelAssociationsCommand

Returns a list of all of the channels associated with the specified bot.

The GetBotChannelAssociations operation requires permissions for the lex:GetBotChannelAssociations action.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { LexModelBuildingServiceClient, GetBotChannelAssociationsCommand } from "@aws-sdk/client-lex-model-building-service"; // ES Modules import
// const { LexModelBuildingServiceClient, GetBotChannelAssociationsCommand } = require("@aws-sdk/client-lex-model-building-service"); // CommonJS import
const client = new LexModelBuildingServiceClient(config);
const input = { // GetBotChannelAssociationsRequest
  botName: "STRING_VALUE", // required
  botAlias: "STRING_VALUE", // required
  nextToken: "STRING_VALUE",
  maxResults: Number("int"),
  nameContains: "STRING_VALUE",
};
const command = new GetBotChannelAssociationsCommand(input);
const response = await client.send(command);
// { // GetBotChannelAssociationsResponse
//   botChannelAssociations: [ // BotChannelAssociationList
//     { // BotChannelAssociation
//       name: "STRING_VALUE",
//       description: "STRING_VALUE",
//       botAlias: "STRING_VALUE",
//       botName: "STRING_VALUE",
//       createdDate: new Date("TIMESTAMP"),
//       type: "Facebook" || "Slack" || "Twilio-Sms" || "Kik",
//       botConfiguration: { // ChannelConfigurationMap
//         "<keys>": "STRING_VALUE",
//       },
//       status: "IN_PROGRESS" || "CREATED" || "FAILED",
//       failureReason: "STRING_VALUE",
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

GetBotChannelAssociationsCommand Input

Parameter
Type
Description
botAlias
Required
string | undefined

An alias pointing to the specific version of the Amazon Lex bot to which this association is being made.

botName
Required
string | undefined

The name of the Amazon Lex bot in the association.

maxResults
number | undefined

The maximum number of associations to return in the response. The default is 50.

nameContains
string | undefined

Substring to match in channel association names. An association will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz." To return all bot channel associations, use a hyphen ("-") as the nameContains parameter.

nextToken
string | undefined

A pagination token for fetching the next page of associations. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of associations, specify the pagination token in the next request.

GetBotChannelAssociationsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
botChannelAssociations
BotChannelAssociation[] | undefined

An array of objects, one for each association, that provides information about the Amazon Lex bot and its association with the channel.

nextToken
string | undefined

A pagination token that fetches the next page of associations. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of associations, specify the pagination token in the next request.

Throws

Name
Fault
Details
BadRequestException
client

The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

InternalFailureException
server

An internal Amazon Lex error occurred. Try your request again.

LimitExceededException
client

The request exceeded a limit. Try your request again.

LexModelBuildingServiceServiceException
Base exception class for all service exceptions from LexModelBuildingService service.