Amazon Connect Service

2022/12/06 - Amazon Connect Service - 5 new api methods

Changes  This release provides APIs that enable you to programmatically manage rules for Contact Lens conversational analytics and third party applications. For more information, see https://docs.aws.amazon.com/connect/latest/APIReference/rules-api.html

ListRules (new) Link ¶

List all rules for the specified Amazon Connect instance.

See also: AWS API Documentation

Request Syntax

client.list_rules(
    InstanceId='string',
    PublishStatus='DRAFT'|'PUBLISHED',
    EventSourceName='OnPostCallAnalysisAvailable'|'OnRealTimeCallAnalysisAvailable'|'OnPostChatAnalysisAvailable'|'OnZendeskTicketCreate'|'OnZendeskTicketStatusUpdate'|'OnSalesforceCaseCreate',
    MaxResults=123,
    NextToken='string'
)
type InstanceId

string

param InstanceId

[REQUIRED]

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

type PublishStatus

string

param PublishStatus

The publish status of the rule.

type EventSourceName

string

param EventSourceName

The name of the event source.

type MaxResults

integer

param MaxResults

The maximum number of results to return per page.

type NextToken

string

param NextToken

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.

rtype

dict

returns

Response Syntax

{
    'RuleSummaryList': [
        {
            'Name': 'string',
            'RuleId': 'string',
            'RuleArn': 'string',
            'EventSourceName': 'OnPostCallAnalysisAvailable'|'OnRealTimeCallAnalysisAvailable'|'OnPostChatAnalysisAvailable'|'OnZendeskTicketCreate'|'OnZendeskTicketStatusUpdate'|'OnSalesforceCaseCreate',
            'PublishStatus': 'DRAFT'|'PUBLISHED',
            'ActionSummaries': [
                {
                    'ActionType': 'CREATE_TASK'|'ASSIGN_CONTACT_CATEGORY'|'GENERATE_EVENTBRIDGE_EVENT'|'SEND_NOTIFICATION'
                },
            ],
            'CreatedTime': datetime(2015, 1, 1),
            'LastUpdatedTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • RuleSummaryList (list) --

      Summary information about a rule.

      • (dict) --

        A list of ActionTypes associated with a rule.

        • Name (string) --

          The name of the rule.

        • RuleId (string) --

          A unique identifier for the rule.

        • RuleArn (string) --

          The Amazon Resource Name (ARN) of the rule.

        • EventSourceName (string) --

          The name of the event source.

        • PublishStatus (string) --

          The publish status of the rule.

        • ActionSummaries (list) --

          A list of ActionTypes associated with a rule.

          • (dict) --

            Information about an action.

            • ActionType (string) --

              The action type.

        • CreatedTime (datetime) --

          The timestamp for when the rule was created.

        • LastUpdatedTime (datetime) --

          The timestamp for when the rule was last updated.

    • NextToken (string) --

      If there are additional results, this is the token for the next set of results.

UpdateRule (new) Link ¶

Updates a rule for the specified Amazon Connect instance.

See also: AWS API Documentation

Request Syntax

client.update_rule(
    RuleId='string',
    InstanceId='string',
    Name='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'
)
type RuleId

string

param RuleId

[REQUIRED]

A unique identifier for the rule.

type InstanceId

string

param InstanceId

[REQUIRED]

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

type Name

string

param Name

[REQUIRED]

The name of the rule. You can change the name only if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate

type Function

string

param Function

[REQUIRED]

The conditions of the rule.

type Actions

list

param Actions

[REQUIRED]

A list of actions to be run when the rule is triggered.

  • (dict) --

    Information about the action to be performed when a rule is triggered.

    • ActionType (string) -- [REQUIRED]

      The type of action that creates a rule.

    • TaskAction (dict) --

      Information about the task action. This field is required if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate

      • Name (string) -- [REQUIRED]

        The name. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

      • Description (string) --

        The description. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

      • ContactFlowId (string) -- [REQUIRED]

        The identifier of the flow.

      • References (dict) --

        Information about the reference when the referenceType is URL . Otherwise, null. (Supports variable injection in the Value field.)

        • (string) --

          • (dict) --

            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.

            • Value (string) -- [REQUIRED]

              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).

            • Type (string) -- [REQUIRED]

              The type of the reference. DATE must be of type Epoch timestamp.

    • EventBridgeAction (dict) --

      Information about the EventBridge action.

      • Name (string) -- [REQUIRED]

        The name.

    • AssignContactCategoryAction (dict) --

      Information about the contact category action.

    • SendNotificationAction (dict) --

      Information about the send notification action.

      • DeliveryMethod (string) -- [REQUIRED]

        Notification delivery method.

      • Subject (string) --

        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 .

      • Content (string) -- [REQUIRED]

        Notification content. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

      • ContentType (string) -- [REQUIRED]

        Content type format.

      • Recipient (dict) -- [REQUIRED]

        Notification recipient.

        • UserTags (dict) --

          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.

          • (string) --

            • (string) --

        • UserIds (list) --

          A list of user IDs.

          • (string) --

type PublishStatus

string

param PublishStatus

[REQUIRED]

The publish status of the rule.

returns

None

DescribeRule (new) Link ¶

Describes a rule for the specified Amazon Connect instance.

See also: AWS API Documentation

Request Syntax

client.describe_rule(
    InstanceId='string',
    RuleId='string'
)
type InstanceId

string

param InstanceId

[REQUIRED]

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

type RuleId

string

param RuleId

[REQUIRED]

A unique identifier for the rule.

rtype

dict

returns

Response Syntax

{
    'Rule': {
        'Name': 'string',
        'RuleId': 'string',
        'RuleArn': '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',
        'CreatedTime': datetime(2015, 1, 1),
        'LastUpdatedTime': datetime(2015, 1, 1),
        'LastUpdatedBy': 'string',
        'Tags': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • Rule (dict) --

      Information about the rule.

      • Name (string) --

        The name of the rule.

      • RuleId (string) --

        A unique identifier for the rule.

      • RuleArn (string) --

        The Amazon Resource Name (ARN) of the rule.

      • TriggerEventSource (dict) --

        The event source to trigger the rule.

        • EventSourceName (string) --

          The name of the event source.

        • IntegrationAssociationId (string) --

          The identifier for the integration association.

      • Function (string) --

        The conditions of the rule.

      • Actions (list) --

        A list of actions to be run when the rule is triggered.

        • (dict) --

          Information about the action to be performed when a rule is triggered.

          • ActionType (string) --

            The type of action that creates a rule.

          • TaskAction (dict) --

            Information about the task action. This field is required if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate

            • Name (string) --

              The name. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

            • Description (string) --

              The description. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

            • ContactFlowId (string) --

              The identifier of the flow.

            • References (dict) --

              Information about the reference when the referenceType is URL . Otherwise, null. (Supports variable injection in the Value field.)

              • (string) --

                • (dict) --

                  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.

                  • Value (string) --

                    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).

                  • Type (string) --

                    The type of the reference. DATE must be of type Epoch timestamp.

          • EventBridgeAction (dict) --

            Information about the EventBridge action.

            • Name (string) --

              The name.

          • AssignContactCategoryAction (dict) --

            Information about the contact category action.

          • SendNotificationAction (dict) --

            Information about the send notification action.

            • DeliveryMethod (string) --

              Notification delivery method.

            • Subject (string) --

              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 .

            • Content (string) --

              Notification content. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

            • ContentType (string) --

              Content type format.

            • Recipient (dict) --

              Notification recipient.

              • UserTags (dict) --

                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.

                • (string) --

                  • (string) --

              • UserIds (list) --

                A list of user IDs.

                • (string) --

      • PublishStatus (string) --

        The publish status of the rule.

      • CreatedTime (datetime) --

        The timestamp for when the rule was created.

      • LastUpdatedTime (datetime) --

        The timestamp for the when the rule was last updated.

      • LastUpdatedBy (string) --

        The Amazon Resource Name (ARN) of the user who last updated the rule.

      • Tags (dict) --

        The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

        • (string) --

          • (string) --

CreateRule (new) Link ¶

Creates a rule for the specified Amazon Connect instance.

See also: AWS API Documentation

Request Syntax

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'
)
type InstanceId

string

param InstanceId

[REQUIRED]

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

type Name

string

param Name

[REQUIRED]

A unique name for the rule.

type TriggerEventSource

dict

param TriggerEventSource

[REQUIRED]

The event source to trigger the rule.

  • EventSourceName (string) -- [REQUIRED]

    The name of the event source.

  • IntegrationAssociationId (string) --

    The identifier for the integration association.

type Function

string

param Function

[REQUIRED]

The conditions of the rule.

type Actions

list

param Actions

[REQUIRED]

A list of actions to be run when the rule is triggered.

  • (dict) --

    Information about the action to be performed when a rule is triggered.

    • ActionType (string) -- [REQUIRED]

      The type of action that creates a rule.

    • TaskAction (dict) --

      Information about the task action. This field is required if TriggerEventSource is one of the following values: OnZendeskTicketCreate | OnZendeskTicketStatusUpdate | OnSalesforceCaseCreate

      • Name (string) -- [REQUIRED]

        The name. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

      • Description (string) --

        The description. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

      • ContactFlowId (string) -- [REQUIRED]

        The identifier of the flow.

      • References (dict) --

        Information about the reference when the referenceType is URL . Otherwise, null. (Supports variable injection in the Value field.)

        • (string) --

          • (dict) --

            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.

            • Value (string) -- [REQUIRED]

              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).

            • Type (string) -- [REQUIRED]

              The type of the reference. DATE must be of type Epoch timestamp.

    • EventBridgeAction (dict) --

      Information about the EventBridge action.

      • Name (string) -- [REQUIRED]

        The name.

    • AssignContactCategoryAction (dict) --

      Information about the contact category action.

    • SendNotificationAction (dict) --

      Information about the send notification action.

      • DeliveryMethod (string) -- [REQUIRED]

        Notification delivery method.

      • Subject (string) --

        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 .

      • Content (string) -- [REQUIRED]

        Notification content. Supports variable injection. For more information, see JSONPath reference in the Amazon Connect Administrators Guide .

      • ContentType (string) -- [REQUIRED]

        Content type format.

      • Recipient (dict) -- [REQUIRED]

        Notification recipient.

        • UserTags (dict) --

          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.

          • (string) --

            • (string) --

        • UserIds (list) --

          A list of user IDs.

          • (string) --

type PublishStatus

string

param PublishStatus

[REQUIRED]

The publish status of the rule.

type ClientToken

string

param ClientToken

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.

rtype

dict

returns

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.

DeleteRule (new) Link ¶

Deletes a rule for the specified Amazon Connect instance.

See also: AWS API Documentation

Request Syntax

client.delete_rule(
    InstanceId='string',
    RuleId='string'
)
type InstanceId

string

param InstanceId

[REQUIRED]

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

type RuleId

string

param RuleId

[REQUIRED]

A unique identifier for the rule.

returns

None