Skip to content

search_all_related_items

search_all_related_items(
    domain_id: DomainId,
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[NextToken] = None,
    filters: Optional[RelatedItemFilterList] = None,
    sorts: Optional[SearchAllRelatedItemsSortList] = None,
) -> SearchAllRelatedItemsResponse

Searches for related items across all cases within a domain. This is a global search operation that returns related items from multiple cases, unlike the case-specific SearchRelatedItems API.

Use cases

Following are common uses cases for this API:

  • Find cases with similar issues across the domain. For example, search for all cases containing comments about "product defect" to identify patterns and existing solutions.

  • Locate all cases associated with specific contacts or orders. For example, find all cases linked to a contactArn to understand the complete customer journey.

  • Monitor SLA compliance across cases. For example, search for all cases with "Active" SLA status to prioritize remediation efforts.

Important things to know

  • This API returns case identifiers, not complete case objects. To retrieve full case details, you must make additional calls to the GetCase API for each returned case ID.

  • This API searches across related items content, not case fields. Use the SearchCases API to search within case field values.

Endpoints: See Amazon Connect endpoints and quotas.

Parameters:

  • domain_id (DomainId) –

    The unique identifier of the Cases domain.

  • max_results (Optional[int], default: None ) –

    The maximum number of results to return per page.

  • next_token (Optional[NextToken], default: None ) –

    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.

  • filters (Optional[RelatedItemFilterList], default: None ) –

    The list of types of related items and their parameters to use for filtering. The filters work as an OR condition: caller gets back related items that match any of the specified filter types.

  • sorts (Optional[SearchAllRelatedItemsSortList], default: None ) –

    A structured set of sort terms to specify the order in which related items should be returned. Supports sorting by association time or case ID. The sorts work in the order specified: first sort term takes precedence over subsequent terms.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • InternalServerException –

    We couldn't process your request because of an issue with the server. Try again later.

  • ResourceNotFoundException –

    We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.

  • ThrottlingException –

    The rate has been exceeded for this API. Please try again after a few minutes.

  • ValidationException –

    The request isn't valid. Check the syntax and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_connectcases/_services/connect_cases.py
def search_all_related_items(
    self,
    domain_id: "capo_connectcases.types.domain_id.DomainId",
    *,
    config_overrides: Optional[ConnectCasesClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional["capo_connectcases.types.next_token.NextToken"] = None,
    filters: Optional[
        "capo_connectcases.types.related_item_filter_list.RelatedItemFilterList"
    ] = None,
    sorts: Optional[
        "capo_connectcases.types.search_all_related_items_sort_list.SearchAllRelatedItemsSortList"
    ] = None,
) -> "capo_connectcases.types.search_all_related_items_response.SearchAllRelatedItemsResponse":
    """<p>Searches for related items across all cases within a domain. This is a global search operation that returns related items from multiple cases, unlike the case-specific <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_SearchRelatedItems.html">SearchRelatedItems</a> API.</p> <p> <b>Use cases</b> </p> <p>Following are common uses cases for this API:</p> <ul> <li> <p>Find cases with similar issues across the domain. For example, search for all cases containing comments about "product defect" to identify patterns and existing solutions.</p> </li> <li> <p>Locate all cases associated with specific contacts or orders. For example, find all cases linked to a contactArn to understand the complete customer journey. </p> </li> <li> <p>Monitor SLA compliance across cases. For example, search for all cases with "Active" SLA status to prioritize remediation efforts.</p> </li> </ul> <p> <b>Important things to know</b> </p> <ul> <li> <p>This API returns case identifiers, not complete case objects. To retrieve full case details, you must make additional calls to the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_GetCase.html">GetCase</a> API for each returned case ID. </p> </li> <li> <p>This API searches across related items content, not case fields. Use the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_SearchCases.html">SearchCases</a> API to search within case field values.</p> </li> </ul> <p> <b>Endpoints</b>: See <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect endpoints and quotas</a>.</p>

    Args:
        domain_id: <p>The unique identifier of the Cases domain. </p>
        max_results: <p>The maximum number of results to return per page.</p>
        next_token: <p>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.</p>
        filters: <p>The list of types of related items and their parameters to use for filtering. The filters work as an OR condition: caller gets back related items that match any of the specified filter types.</p>
        sorts: <p>A structured set of sort terms to specify the order in which related items should be returned. Supports sorting by association time or case ID. The sorts work in the order specified: first sort term takes precedence over subsequent terms.</p>

    Raises:
        capo_connectcases.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_connectcases.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_connectcases.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.</p>
        capo_connectcases.errors.throttling_exception.ThrottlingException: <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
        capo_connectcases.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_connectcases.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connectcases.types.search_all_related_items_request.SearchAllRelatedItemsRequest]",
    ) -> OperationResponse[
        "capo_connectcases.types.search_all_related_items_response.SearchAllRelatedItemsResponse"
    ]:
        import capo_connectcases._operations.amazon_connect_cases.search_all_related_items

        output, http_response = (
            capo_connectcases._operations.amazon_connect_cases.search_all_related_items.search_all_related_items(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_connectcases.types.search_all_related_items_request.SearchAllRelatedItemsRequest",
    ) -> dict[str, Any]:
        import capo_connectcases.types.search_all_related_items_request

        return capo_connectcases.types.search_all_related_items_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_connectcases.types.search_all_related_items_response.SearchAllRelatedItemsResponse",
    ) -> dict[str, Any]:
        import capo_connectcases.types.search_all_related_items_response

        return capo_connectcases.types.search_all_related_items_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "SearchAllRelatedItems",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_connectcases.types.search_all_related_items_request.SearchAllRelatedItemsRequest = {
        "domain_id": domain_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filters is not None:
        input_["filters"] = filters
    if sorts is not None:
        input_["sorts"] = sorts

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output