:doc:`Connect <../../connect>` / Client / search_notifications

********************
search_notifications
********************



.. py:method:: Connect.Client.search_notifications(**kwargs)

  

  Searches for notifications based on specified criteria and filters. Returns a paginated list of notifications matching the search parameters, ordered by descending creation time. Supports filtering by content and tags.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/SearchNotifications>`_  


  **Request Syntax**
  ::

    response = client.search_notifications(
        InstanceId='string',
        NextToken='string',
        MaxResults=123,
        SearchFilter={
            'AttributeFilter': {
                'OrConditions': [
                    {
                        'TagConditions': [
                            {
                                'TagKey': 'string',
                                'TagValue': 'string'
                            },
                        ]
                    },
                ],
                'AndCondition': {
                    'TagConditions': [
                        {
                            'TagKey': 'string',
                            'TagValue': 'string'
                        },
                    ]
                },
                'TagCondition': {
                    'TagKey': 'string',
                    'TagValue': 'string'
                }
            }
        },
        SearchCriteria={
            'OrConditions': [
                {'... recursive ...'},
            ],
            'AndConditions': [
                {'... recursive ...'},
            ],
            'StringCondition': {
                'FieldName': 'string',
                'Value': 'string',
                'ComparisonType': 'STARTS_WITH'|'CONTAINS'|'EXACT'
            }
        }
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The identifier of the Amazon Connect instance. You can `find the instance ID <https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html>`__ in the Amazon Resource Name (ARN) of the instance.

    

  
  :type NextToken: string
  :param NextToken: 

    The token for the next set of results. Use the value returned in the previous response to retrieve the next page of results.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return per page. Valid range is 1-100.

    

  
  :type SearchFilter: dict
  :param SearchFilter: 

    Filters to apply to the search results, such as tag-based filters.

    

  
    - **AttributeFilter** *(dict) --* 

      Attribute-based filters to apply to the search results.

      

    
      - **OrConditions** *(list) --* 

        A list of conditions which would be applied together with an ``OR`` condition.

        

      
        - *(dict) --* 

          A list of conditions which would be applied together with an ``AND`` condition.

          

        
          - **TagConditions** *(list) --* 

            A leaf node condition which can be used to specify a tag condition.

            

          
            - *(dict) --* 

              A leaf node condition which can be used to specify a tag condition, for example, ``HAVE BPO = 123``.

              

            
              - **TagKey** *(string) --* 

                The tag key in the tag condition.

                

              
              - **TagValue** *(string) --* 

                The tag value in the tag condition.

                

              
            
        
        
    
      - **AndCondition** *(dict) --* 

        A list of conditions which would be applied together with an ``AND`` condition.

        

      
        - **TagConditions** *(list) --* 

          A leaf node condition which can be used to specify a tag condition.

          

        
          - *(dict) --* 

            A leaf node condition which can be used to specify a tag condition, for example, ``HAVE BPO = 123``.

            

          
            - **TagKey** *(string) --* 

              The tag key in the tag condition.

              

            
            - **TagValue** *(string) --* 

              The tag value in the tag condition.

              

            
          
      
      
      - **TagCondition** *(dict) --* 

        A leaf node condition which can be used to specify a tag condition, for example, ``HAVE BPO = 123``.

        

      
        - **TagKey** *(string) --* 

          The tag key in the tag condition.

          

        
        - **TagValue** *(string) --* 

          The tag value in the tag condition.

          

        
      
    
  
  :type SearchCriteria: dict
  :param SearchCriteria: 

    The search criteria to apply when searching for notifications. Supports filtering by notification ID and message content using comparison types such as STARTS_WITH, CONTAINS, and EXACT.

    

  
    - **OrConditions** *(list) --* 

      A list of conditions to be met, where at least one condition must be satisfied.

      

    
      - *(dict) --* 

        The search criteria to be used to return notifications.

        

      
  
    - **AndConditions** *(list) --* 

      A list of conditions that must all be satisfied.

      

    
      - *(dict) --* 

        The search criteria to be used to return notifications.

        

      
  
    - **StringCondition** *(dict) --* 

      A leaf node condition which can be used to specify a string condition.

      

    
      - **FieldName** *(string) --* 

        The name of the field in the string condition.

        

      
      - **Value** *(string) --* 

        The value of the string.

        

      
      - **ComparisonType** *(string) --* 

        The type of comparison to be made when evaluating the string condition.

        

      
    
  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Notifications': [
              {
                  'Id': 'string',
                  'Arn': 'string',
                  'InstanceId': 'string',
                  'Content': {
                      'string': 'string'
                  },
                  'Priority': 'URGENT'|'HIGH'|'LOW',
                  'Recipients': [
                      'string',
                  ],
                  'CreatedAt': datetime(2015, 1, 1),
                  'ExpiresAt': datetime(2015, 1, 1),
                  'LastModifiedRegion': 'string',
                  'LastModifiedTime': datetime(2015, 1, 1),
                  'Tags': {
                      'string': 'string'
                  }
              },
          ],
          'NextToken': 'string',
          'ApproximateTotalCount': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Notifications** *(list) --* 

        A list of notifications matching the search criteria.

        
        

        - *(dict) --* 

          Summary information about a notification returned from a search operation.

          
          

          - **Id** *(string) --* 

            The unique identifier for the notification.

            
          

          - **Arn** *(string) --* 

            The Amazon Resource Name (ARN) of the notification.

            
          

          - **InstanceId** *(string) --* 

            The identifier of the Amazon Connect instance.

            
          

          - **Content** *(dict) --* 

            The localized content of the notification.

            
            

            - *(string) --* 

              The locale code for localized content. Supported values include en_US, de_DE, es_ES, fr_FR, id_ID, it_IT, ja_JP, ko_KR, pt_BR, zh_CN, and zh_TW.

              
              

              - *(string) --* 

                A localized string value. Maximum length is 500 characters.

                
        
      
          

          - **Priority** *(string) --* 

            The priority level of the notification.

            
          

          - **Recipients** *(list) --* 

            A list of recipient Amazon Resource Names (ARNs).

            
            

            - *(string) --* 
        
          

          - **CreatedAt** *(datetime) --* 

            The timestamp when the notification was created.

            
          

          - **ExpiresAt** *(datetime) --* 

            The timestamp when the notification expires.

            
          

          - **LastModifiedRegion** *(string) --* 

            The AWS Region where the notification was last modified.

            
          

          - **LastModifiedTime** *(datetime) --* 

            The timestamp when the notification was last modified.

            
          

          - **Tags** *(dict) --* 

            The tags associated with the notification.

            
            

            - *(string) --* 
              

              - *(string) --* 
        
      
      
    
      

      - **NextToken** *(string) --* 

        The token for the next set of results. If present, there are more results available.

        
      

      - **ApproximateTotalCount** *(integer) --* 

        The approximate total number of notifications matching the search criteria.

        
  
  **Exceptions**
  
  *   :py:class:`Connect.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Connect.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Connect.Client.exceptions.InternalServiceException`

  
  *   :py:class:`Connect.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Connect.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Connect.Client.exceptions.InvalidParameterException`

  