- 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.
ListRulesCommand
List all rules for the specified Amazon Connect instance.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ConnectClient, ListRulesCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, ListRulesCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // ListRulesRequest
InstanceId: "STRING_VALUE", // required
PublishStatus: "DRAFT" || "PUBLISHED",
EventSourceName: "OnPostCallAnalysisAvailable" || "OnRealTimeCallAnalysisAvailable" || "OnRealTimeChatAnalysisAvailable" || "OnPostChatAnalysisAvailable" || "OnZendeskTicketCreate" || "OnZendeskTicketStatusUpdate" || "OnSalesforceCaseCreate" || "OnContactEvaluationSubmit" || "OnMetricDataUpdate" || "OnCaseCreate" || "OnCaseUpdate",
MaxResults: Number("int"),
NextToken: "STRING_VALUE",
};
const command = new ListRulesCommand(input);
const response = await client.send(command);
// { // ListRulesResponse
// RuleSummaryList: [ // RuleSummaryList // required
// { // RuleSummary
// Name: "STRING_VALUE", // required
// RuleId: "STRING_VALUE", // required
// RuleArn: "STRING_VALUE", // required
// EventSourceName: "OnPostCallAnalysisAvailable" || "OnRealTimeCallAnalysisAvailable" || "OnRealTimeChatAnalysisAvailable" || "OnPostChatAnalysisAvailable" || "OnZendeskTicketCreate" || "OnZendeskTicketStatusUpdate" || "OnSalesforceCaseCreate" || "OnContactEvaluationSubmit" || "OnMetricDataUpdate" || "OnCaseCreate" || "OnCaseUpdate", // required
// PublishStatus: "DRAFT" || "PUBLISHED", // required
// ActionSummaries: [ // ActionSummaries // required
// { // ActionSummary
// ActionType: "CREATE_TASK" || "ASSIGN_CONTACT_CATEGORY" || "GENERATE_EVENTBRIDGE_EVENT" || "SEND_NOTIFICATION" || "CREATE_CASE" || "UPDATE_CASE" || "END_ASSOCIATED_TASKS" || "SUBMIT_AUTO_EVALUATION", // required
// },
// ],
// CreatedTime: new Date("TIMESTAMP"), // required
// LastUpdatedTime: new Date("TIMESTAMP"), // required
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListRulesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
InstanceId Required | string | undefined | The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance. |
EventSourceName | EventSourceName | undefined | The name of the event source. |
MaxResults | number | undefined | The maximum number of results to return per page. |
NextToken | string | undefined | The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. |
PublishStatus | RulePublishStatus | undefined | The publish status of the rule. |
ListRulesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
RuleSummaryList Required | RuleSummary[] | undefined | Summary information about a rule. |
NextToken | string | undefined | If there are additional results, this is the token for the next set of results. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient permissions to perform this action. |
InternalServiceException | server | Request processing failed because of an error or failure with the service. |
InvalidRequestException | client | The request is not valid. |
ResourceNotFoundException | client | The specified resource was not found. |
ThrottlingException | client | The throttling limit has been exceeded. |
ConnectServiceException | Base exception class for all service exceptions from Connect service. |