Connect.Client.
create_rule
(**kwargs)¶Creates a rule for the specified Amazon Connect instance.
Use the Rules Function language to code conditions for the rule.
See also: AWS API Documentation
Request Syntax
response = client.create_rule(
InstanceId='string',
Name='string',
TriggerEventSource={
'EventSourceName': 'OnPostCallAnalysisAvailable'|'OnRealTimeCallAnalysisAvailable'|'OnPostChatAnalysisAvailable'|'OnZendeskTicketCreate'|'OnZendeskTicketStatusUpdate'|'OnSalesforceCaseCreate',
'IntegrationAssociationId': 'string'
},
Function='string',
Actions=[
{
'ActionType': 'CREATE_TASK'|'ASSIGN_CONTACT_CATEGORY'|'GENERATE_EVENTBRIDGE_EVENT'|'SEND_NOTIFICATION',
'TaskAction': {
'Name': 'string',
'Description': 'string',
'ContactFlowId': 'string',
'References': {
'string': {
'Value': 'string',
'Type': 'URL'|'ATTACHMENT'|'NUMBER'|'STRING'|'DATE'|'EMAIL'
}
}
},
'EventBridgeAction': {
'Name': 'string'
},
'AssignContactCategoryAction': {}
,
'SendNotificationAction': {
'DeliveryMethod': 'EMAIL',
'Subject': 'string',
'Content': 'string',
'ContentType': 'PLAIN_TEXT',
'Recipient': {
'UserTags': {
'string': 'string'
},
'UserIds': [
'string',
]
}
}
},
],
PublishStatus='DRAFT'|'PUBLISHED',
ClientToken='string'
)
[REQUIRED]
The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
[REQUIRED]
A unique name for the rule.
[REQUIRED]
The event source to trigger the rule.
The name of the event source.
The identifier for the integration association.
[REQUIRED]
The conditions of the rule.
[REQUIRED]
A list of actions to be run when the rule is triggered.
Information about the action to be performed when a rule is triggered.
The type of action that creates a rule.
Information about the task action. This field is required if TriggerEventSource
is one of the following values: OnZendeskTicketCreate
| OnZendeskTicketStatusUpdate
| OnSalesforceCaseCreate
The name. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .
The description. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .
The identifier of the flow.
Information about the reference when the referenceType
is URL
. Otherwise, null. (Supports variable injection in the Value
field.)
Well-formed data on a contact, used by agents to complete a contact request. You can have up to 4,096 UTF-8 bytes across all references for a contact.
A valid value for the reference. For example, for a URL reference, a formatted URL that is displayed to an agent in the Contact Control Panel (CCP).
The type of the reference. DATE
must be of type Epoch timestamp.
Information about the EventBridge action.
The name.
Information about the contact category action.
Information about the send notification action.
Notification delivery method.
The subject of the email if the delivery method is EMAIL
. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .
Notification content. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .
Content type format.
Notification recipient.
The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }. Amazon Connect users with the specified tags will be notified.
A list of user IDs.
[REQUIRED]
The publish status of the rule.
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
This field is autopopulated if not provided.
dict
Response Syntax
{
'RuleArn': 'string',
'RuleId': 'string'
}
Response Structure
(dict) --
RuleArn (string) --
The Amazon Resource Name (ARN) of the rule.
RuleId (string) --
A unique identifier for the rule.
Exceptions
Connect.Client.exceptions.InvalidRequestException
Connect.Client.exceptions.ResourceNotFoundException
Connect.Client.exceptions.InternalServiceException
Connect.Client.exceptions.ThrottlingException
Connect.Client.exceptions.AccessDeniedException
Connect.Client.exceptions.ResourceConflictException
Connect.Client.exceptions.ServiceQuotaExceededException