Connect / Paginator / SearchContacts

SearchContacts

class Connect.Paginator.SearchContacts
paginator = client.get_paginator('search_contacts')
paginate(**kwargs)

Creates an iterator that will paginate through responses from Connect.Client.search_contacts().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    InstanceId='string',
    TimeRange={
        'Type': 'INITIATION_TIMESTAMP'|'SCHEDULED_TIMESTAMP'|'CONNECTED_TO_AGENT_TIMESTAMP'|'DISCONNECT_TIMESTAMP'|'ENQUEUE_TIMESTAMP',
        'StartTime': datetime(2015, 1, 1),
        'EndTime': datetime(2015, 1, 1)
    },
    SearchCriteria={
        'Name': {
            'SearchText': [
                'string',
            ],
            'MatchType': 'MATCH_ALL'|'MATCH_ANY'|'MATCH_EXACT'|'MATCH_NONE'
        },
        'AgentIds': [
            'string',
        ],
        'AgentHierarchyGroups': {
            'L1Ids': [
                'string',
            ],
            'L2Ids': [
                'string',
            ],
            'L3Ids': [
                'string',
            ],
            'L4Ids': [
                'string',
            ],
            'L5Ids': [
                'string',
            ]
        },
        'Channels': [
            'VOICE'|'CHAT'|'TASK'|'EMAIL',
        ],
        'ContactAnalysis': {
            'Transcript': {
                'Criteria': [
                    {
                        'ParticipantRole': 'AGENT'|'CUSTOMER'|'SYSTEM'|'CUSTOM_BOT'|'SUPERVISOR',
                        'SearchText': [
                            'string',
                        ],
                        'MatchType': 'MATCH_ALL'|'MATCH_ANY'|'MATCH_EXACT'|'MATCH_NONE'
                    },
                ],
                'MatchType': 'MATCH_ALL'|'MATCH_ANY'|'MATCH_EXACT'|'MATCH_NONE'
            }
        },
        'InitiationMethods': [
            'INBOUND'|'OUTBOUND'|'TRANSFER'|'QUEUE_TRANSFER'|'CALLBACK'|'API'|'DISCONNECT'|'MONITOR'|'EXTERNAL_OUTBOUND'|'WEBRTC_API'|'AGENT_REPLY'|'FLOW',
        ],
        'QueueIds': [
            'string',
        ],
        'RoutingCriteria': {
            'Steps': [
                {
                    'AgentCriteria': {
                        'AgentIds': [
                            'string',
                        ],
                        'MatchType': 'MATCH_ALL'|'MATCH_ANY'|'MATCH_EXACT'|'MATCH_NONE'
                    }
                },
            ]
        },
        'AdditionalTimeRange': {
            'Criteria': [
                {
                    'TimeRange': {
                        'Type': 'INITIATION_TIMESTAMP'|'SCHEDULED_TIMESTAMP'|'CONNECTED_TO_AGENT_TIMESTAMP'|'DISCONNECT_TIMESTAMP'|'ENQUEUE_TIMESTAMP',
                        'StartTime': datetime(2015, 1, 1),
                        'EndTime': datetime(2015, 1, 1)
                    },
                    'TimestampCondition': {
                        'Type': 'INITIATION_TIMESTAMP'|'SCHEDULED_TIMESTAMP'|'CONNECTED_TO_AGENT_TIMESTAMP'|'DISCONNECT_TIMESTAMP'|'ENQUEUE_TIMESTAMP',
                        'ConditionType': 'NOT_EXISTS'
                    }
                },
            ],
            'MatchType': 'MATCH_ALL'|'MATCH_ANY'|'MATCH_EXACT'|'MATCH_NONE'
        },
        'SearchableContactAttributes': {
            'Criteria': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'MatchType': 'MATCH_ALL'|'MATCH_ANY'|'MATCH_EXACT'|'MATCH_NONE'
        },
        'SearchableSegmentAttributes': {
            'Criteria': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'MatchType': 'MATCH_ALL'|'MATCH_ANY'|'MATCH_EXACT'|'MATCH_NONE'
        }
    },
    Sort={
        'FieldName': 'INITIATION_TIMESTAMP'|'SCHEDULED_TIMESTAMP'|'CONNECTED_TO_AGENT_TIMESTAMP'|'DISCONNECT_TIMESTAMP'|'INITIATION_METHOD'|'CHANNEL'|'EXPIRY_TIMESTAMP',
        'Order': 'ASCENDING'|'DESCENDING'
    },
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • InstanceId (string) –

    [REQUIRED]

    The identifier of Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • TimeRange (dict) –

    [REQUIRED]

    Time range that you want to search results.

    • Type (string) – [REQUIRED]

      The type of timestamp to search.

    • StartTime (datetime) – [REQUIRED]

      The start time of the time range.

    • EndTime (datetime) – [REQUIRED]

      The end time of the time range.

  • SearchCriteria (dict) –

    The search criteria to be used to return contacts.

    • Name (dict) –

      Name of the contact.

      • SearchText (list) – [REQUIRED]

        The words or phrases used to match the contact name.

        • (string) –

      • MatchType (string) – [REQUIRED]

        The match type combining name search criteria using multiple search texts in a name criteria.

    • AgentIds (list) –

      The identifiers of agents who handled the contacts.

      • (string) –

    • AgentHierarchyGroups (dict) –

      The agent hierarchy groups of the agent at the time of handling the contact.

      • L1Ids (list) –

        The identifiers for level 1 hierarchy groups.

        • (string) –

      • L2Ids (list) –

        The identifiers for level 2 hierarchy groups.

        • (string) –

      • L3Ids (list) –

        The identifiers for level 3 hierarchy groups.

        • (string) –

      • L4Ids (list) –

        The identifiers for level 4 hierarchy groups.

        • (string) –

      • L5Ids (list) –

        The identifiers for level 5 hierarchy groups.

        • (string) –

    • Channels (list) –

      The list of channels associated with contacts.

      • (string) –

    • ContactAnalysis (dict) –

      Search criteria based on analysis outputs from Amazon Connect Contact Lens.

      • Transcript (dict) –

        Search criteria based on transcript analyzed by Amazon Connect Contact Lens.

        • Criteria (list) – [REQUIRED]

          The list of search criteria based on Contact Lens conversational analytics transcript.

          • (dict) –

            A structure that defines search criteria base on words or phrases, participants in the Contact Lens conversational analytics transcript.

            • ParticipantRole (string) – [REQUIRED]

              The participant role in a transcript

            • SearchText (list) – [REQUIRED]

              The words or phrases used to search within a transcript.

              • (string) –

            • MatchType (string) – [REQUIRED]

              The match type combining search criteria using multiple search texts in a transcript criteria.

        • MatchType (string) –

          The match type combining search criteria using multiple transcript criteria.

    • InitiationMethods (list) –

      The list of initiation methods associated with contacts.

      • (string) –

    • QueueIds (list) –

      The list of queue IDs associated with contacts.

      • (string) –

    • RoutingCriteria (dict) –

      Routing criteria for the contact.

      • Steps (list) –

        The list of Routing criteria steps of the contact routing.

        • (dict) –

          Routing criteria of the contact to match on.

          • AgentCriteria (dict) –

            Agent matching the routing step of the routing criteria

            • AgentIds (list) –

              The identifiers of agents used in preferred agents matching.

              • (string) –

            • MatchType (string) –

              The match type combining multiple agent criteria steps.

    • AdditionalTimeRange (dict) –

      Additional TimeRange used to filter contacts.

      • Criteria (list) – [REQUIRED]

        List of criteria of the time range to additionally filter on.

        • (dict) –

          The criteria of the time range to additionally filter on.

          • TimeRange (dict) –

            A structure of time range that you want to search results.

            • Type (string) – [REQUIRED]

              The type of timestamp to search.

            • StartTime (datetime) – [REQUIRED]

              The start time of the time range.

            • EndTime (datetime) – [REQUIRED]

              The end time of the time range.

          • TimestampCondition (dict) –

            List of the timestamp conditions.

            • Type (string) – [REQUIRED]

              Type of the timestamps to use for the filter.

            • ConditionType (string) – [REQUIRED]

              Condition of the timestamp on the contact.

      • MatchType (string) – [REQUIRED]

        The match type combining multiple time range filters.

    • SearchableContactAttributes (dict) –

      The search criteria based on user-defined contact attributes that have been configured for contact search. For more information, see Search by custom contact attributes in the Amazon Connect Administrator Guide.

      Warning

      To use SearchableContactAttributes in a search request, the GetContactAttributes action is required to perform an API request. For more information, see `https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonconnect.html#amazonconnect-actions-as-permissions <https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonconnect.html#amazonconnect-actions-as-permissions>`__Actions defined by Amazon Connect.

      • Criteria (list) – [REQUIRED]

        The list of criteria based on user-defined contact attributes that are configured for contact search.

        • (dict) –

          The search criteria based on user-defined contact attribute key and values to search on.

          • Key (string) – [REQUIRED]

            The key containing a searchable user-defined contact attribute.

          • Values (list) – [REQUIRED]

            The list of values to search for within a user-defined contact attribute.

            • (string) –

      • MatchType (string) –

        The match type combining search criteria using multiple searchable contact attributes.

    • SearchableSegmentAttributes (dict) –

      The search criteria based on searchable segment attributes of a contact.

      • Criteria (list) – [REQUIRED]

        The list of criteria based on searchable segment attributes.

        • (dict) –

          The search criteria based on searchable segment attribute key and values to search on.

          • Key (string) – [REQUIRED]

            The key containing a searchable segment attribute.

          • Values (list) – [REQUIRED]

            The list of values to search for within a searchable segment attribute.

            • (string) –

      • MatchType (string) –

        The match type combining search criteria using multiple searchable segment attributes.

  • Sort (dict) –

    Specifies a field to sort by and a sort order.

    • FieldName (string) – [REQUIRED]

      The name of the field on which to sort.

    • Order (string) – [REQUIRED]

      An ascending or descending sort.

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) –

      The size of each page.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:

dict

Returns:

Response Syntax

{
    'Contacts': [
        {
            'Arn': 'string',
            'Id': 'string',
            'InitialContactId': 'string',
            'PreviousContactId': 'string',
            'InitiationMethod': 'INBOUND'|'OUTBOUND'|'TRANSFER'|'QUEUE_TRANSFER'|'CALLBACK'|'API'|'DISCONNECT'|'MONITOR'|'EXTERNAL_OUTBOUND'|'WEBRTC_API'|'AGENT_REPLY'|'FLOW',
            'Channel': 'VOICE'|'CHAT'|'TASK'|'EMAIL',
            'QueueInfo': {
                'Id': 'string',
                'EnqueueTimestamp': datetime(2015, 1, 1)
            },
            'AgentInfo': {
                'Id': 'string',
                'ConnectedToAgentTimestamp': datetime(2015, 1, 1)
            },
            'InitiationTimestamp': datetime(2015, 1, 1),
            'DisconnectTimestamp': datetime(2015, 1, 1),
            'ScheduledTimestamp': datetime(2015, 1, 1),
            'SegmentAttributes': {
                'string': {
                    'ValueString': 'string',
                    'ValueMap': {
                        'string': {
                            'ValueString': 'string',
                            'ValueMap': {'... recursive ...'},
                            'ValueInteger': 123,
                            'ValueList': [
                                {'... recursive ...'},
                            ],
                            'ValueArn': 'string'
                        }
                    }
                }
            },
            'Name': 'string',
            'RoutingCriteria': {
                'Steps': [
                    {
                        'Expiry': {
                            'DurationInSeconds': 123,
                            'ExpiryTimestamp': datetime(2015, 1, 1)
                        },
                        'Expression': {
                            'AttributeCondition': {
                                'Name': 'string',
                                'Value': 'string',
                                'ProficiencyLevel': ...,
                                'Range': {
                                    'MinProficiencyLevel': ...,
                                    'MaxProficiencyLevel': ...
                                },
                                'MatchCriteria': {
                                    'AgentsCriteria': {
                                        'AgentIds': [
                                            'string',
                                        ]
                                    }
                                },
                                'ComparisonOperator': 'string'
                            },
                            'AndExpression': [
                                {'... recursive ...'},
                            ],
                            'OrExpression': [
                                {'... recursive ...'},
                            ],
                            'NotAttributeCondition': {
                                'Name': 'string',
                                'Value': 'string',
                                'ProficiencyLevel': ...,
                                'Range': {
                                    'MinProficiencyLevel': ...,
                                    'MaxProficiencyLevel': ...
                                },
                                'MatchCriteria': {
                                    'AgentsCriteria': {
                                        'AgentIds': [
                                            'string',
                                        ]
                                    }
                                },
                                'ComparisonOperator': 'string'
                            }
                        },
                        'Status': 'ACTIVE'|'INACTIVE'|'JOINED'|'EXPIRED'
                    },
                ],
                'ActivationTimestamp': datetime(2015, 1, 1),
                'Index': 123
            }
        },
    ],
    'TotalCount': 123
}

Response Structure

  • (dict) –

    • Contacts (list) –

      Information about the contacts.

      • (dict) –

        Information of returned contact.

        • Arn (string) –

          The Amazon Resource Name (ARN) of the contact.

        • Id (string) –

          The identifier of the contact summary.

        • InitialContactId (string) –

          If this contact is related to other contacts, this is the ID of the initial contact.

        • PreviousContactId (string) –

          If this contact is not the first contact, this is the ID of the previous contact.

        • InitiationMethod (string) –

          Indicates how the contact was initiated.

        • Channel (string) –

          How the contact reached your contact center.

        • QueueInfo (dict) –

          If this contact was queued, this contains information about the queue.

          • Id (string) –

            The unique identifier for the queue.

          • EnqueueTimestamp (datetime) –

            The timestamp when the contact was added to the queue.

        • AgentInfo (dict) –

          Information about the agent who accepted the contact.

          • Id (string) –

            The identifier of the agent who accepted the contact.

          • ConnectedToAgentTimestamp (datetime) –

            The timestamp when the contact was connected to the agent.

        • InitiationTimestamp (datetime) –

          The date and time this contact was initiated, in UTC time. For INBOUND, this is when the contact arrived. For OUTBOUND, this is when the agent began dialing. For CALLBACK, this is when the callback contact was created. For TRANSFER and QUEUE_TRANSFER, this is when the transfer was initiated. For API, this is when the request arrived. For EXTERNAL_OUTBOUND, this is when the agent started dialing the external participant. For MONITOR, this is when the supervisor started listening to a contact.

        • DisconnectTimestamp (datetime) –

          The timestamp when the customer endpoint disconnected from Amazon Connect.

        • ScheduledTimestamp (datetime) –

          The timestamp, in Unix epoch time format, at which to start running the inbound flow.

        • SegmentAttributes (dict) –

          Set of segment attributes for a contact.

          • (string) –

            • (dict) –

              The value of a segment attribute. This is structured as a map with a single key-value pair. The key ‘valueString’ indicates that the attribute type is a string, and its corresponding value is the actual string value of the segment attribute.

              • ValueString (string) –

                The value of a segment attribute represented as a string.

              • ValueMap (dict) –

                The key and value of a segment attribute.

                • (string) –

                  • (dict) –

                    A value for a segment attribute. This is structured as a map where the key is valueString and the value is a string.

                    • ValueString (string) –

                      The value of a segment attribute.

                    • ValueMap (dict) –

                      The value of a segment attribute.

                    • ValueInteger (integer) –

                      The value of a segment attribute.

                    • ValueList (list) –

                      The value of a segment attribute. This is only supported for system-defined attributes, not for user-defined attributes.

                      • (dict) –

                        A value for a segment attribute. This is structured as a map where the key is valueString and the value is a string.

                    • ValueArn (string) –

                      The value of a segment attribute that has to be a valid ARN. This is only supported for system-defined attributes, not for user-defined attributes.

        • Name (string) –

          Indicates name of the contact.

        • RoutingCriteria (dict) –

          Latest routing criteria on the contact.

          • Steps (list) –

            List of routing steps. When Amazon Connect does not find an available agent meeting the requirements in a step for a given step duration, the routing criteria will move on to the next step sequentially until a join is completed with an agent. When all steps are exhausted, the contact will be offered to any agent in the queue.

            • (dict) –

              Step signifies the criteria to be used for routing to an agent

              • Expiry (dict) –

                An object to specify the expiration of a routing step.

                • DurationInSeconds (integer) –

                  The number of seconds to wait before expiring the routing step.

                • ExpiryTimestamp (datetime) –

                  The timestamp indicating when the routing step expires.

              • Expression (dict) –

                A tagged union to specify expression for a routing step.

                • AttributeCondition (dict) –

                  An object to specify the predefined attribute condition.

                  • Name (string) –

                    The name of predefined attribute.

                  • Value (string) –

                    The value of predefined attribute.

                  • ProficiencyLevel (float) –

                    The proficiency level of the condition.

                  • Range (dict) –

                    An Object to define the minimum and maximum proficiency levels.

                    • MinProficiencyLevel (float) –

                      The minimum proficiency level of the range.

                    • MaxProficiencyLevel (float) –

                      The maximum proficiency level of the range.

                  • MatchCriteria (dict) –

                    An object to define AgentsCriteria.

                    • AgentsCriteria (dict) –

                      An object to define agentIds.

                      • AgentIds (list) –

                        An object to specify a list of agents, by user ID.

                        • (string) –

                  • ComparisonOperator (string) –

                    The operator of the condition.

                • AndExpression (list) –

                  List of routing expressions which will be AND-ed together.

                  • (dict) –

                    A tagged union to specify expression for a routing step.

                • OrExpression (list) –

                  List of routing expressions which will be OR-ed together.

                  • (dict) –

                    A tagged union to specify expression for a routing step.

                • NotAttributeCondition (dict) –

                  An object to specify the predefined attribute condition.

                  • Name (string) –

                    The name of predefined attribute.

                  • Value (string) –

                    The value of predefined attribute.

                  • ProficiencyLevel (float) –

                    The proficiency level of the condition.

                  • Range (dict) –

                    An Object to define the minimum and maximum proficiency levels.

                    • MinProficiencyLevel (float) –

                      The minimum proficiency level of the range.

                    • MaxProficiencyLevel (float) –

                      The maximum proficiency level of the range.

                  • MatchCriteria (dict) –

                    An object to define AgentsCriteria.

                    • AgentsCriteria (dict) –

                      An object to define agentIds.

                      • AgentIds (list) –

                        An object to specify a list of agents, by user ID.

                        • (string) –

                  • ComparisonOperator (string) –

                    The operator of the condition.

              • Status (string) –

                Represents status of the Routing step.

          • ActivationTimestamp (datetime) –

            The timestamp indicating when the routing criteria is set to active. A routing criteria is activated when contact is transferred to a queue. ActivationTimestamp will be set on routing criteria for contacts in agent queue even though Routing criteria is never activated for contacts in agent queue.

          • Index (integer) –

            Information about the index of the routing criteria.

    • TotalCount (integer) –

      The total number of contacts which matched your search query.