searchAllRelatedItems method
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.
- 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.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter domainId :
The unique identifier of the Cases domain.
Parameter filters :
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.
Parameter maxResults :
The maximum number of results to return per page.
Parameter 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.
Parameter sorts :
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.
Implementation
Future<SearchAllRelatedItemsResponse> searchAllRelatedItems({
required String domainId,
List<RelatedItemTypeFilter>? filters,
int? maxResults,
String? nextToken,
List<SearchAllRelatedItemsSort>? sorts,
}) async {
final $payload = <String, dynamic>{
if (filters != null) 'filters': filters,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
if (sorts != null) 'sorts': sorts,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/domains/${Uri.encodeComponent(domainId)}/related-items-search',
exceptionFnMap: _exceptionFns,
);
return SearchAllRelatedItemsResponse.fromJson(response);
}