Skip to content

search_profiles async

search_profiles(
    domain_name: name,
    key_name: name,
    values: requestValueList,
    *,
    config_overrides: Optional[AsyncCustomerProfilesClientConfig] = None,
    next_token: Optional[token] = None,
    max_results: Optional[maxSize100] = None,
    additional_search_keys: Optional[additionalSearchKeysList] = None,
    logical_operator: Optional[logicalOperator] = None,
) -> SearchProfilesResponse

Searches for profiles within a specific domain using one or more predefined search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined search keys. A search key is a data type pair that consists of a KeyName and Values list.

This operation supports searching for profiles with a minimum of 1 key-value(s) pair and up to 5 key-value(s) pairs using either AND or OR logic.

Parameters:

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

    The pagination token from the previous SearchProfiles API call.

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

    The maximum number of objects returned per page.

    The default is 20 if this parameter is not included in the request.

  • domain_name (name) –

    The unique name of the domain.

  • key_name (name) –

    A searchable identifier of a customer profile. The predefined keys you can use to search include: _account, _profileId, _assetId, _caseId, _orderId, _fullName, _phone, _email, _ctrContactId, _marketoLeadId, _salesforceAccountId, _salesforceContactId, _salesforceAssetId, _zendeskUserId, _zendeskExternalId, _zendeskTicketId, _serviceNowSystemId, _serviceNowIncidentId, _segmentUserId, _shopifyCustomerId, _shopifyOrderId.

  • values (requestValueList) –

    A list of key values.

  • additional_search_keys (Optional[additionalSearchKeysList], default: None ) –

    A list of AdditionalSearchKey objects that are each searchable identifiers of a profile. Each AdditionalSearchKey object contains a KeyName and a list of Values associated with that specific key (i.e., a key-value(s) pair). These additional search keys will be used in conjunction with the LogicalOperator and the required KeyName and Values parameters to search for profiles that satisfy the search criteria.

  • logical_operator (Optional[logicalOperator], default: None ) –

    Relationship between all specified search keys that will be used to search for profiles. This includes the required KeyName and Values parameters as well as any key-value(s) pairs specified in the AdditionalSearchKeys list.

    This parameter influences which profiles will be returned in the response in the following manner:

    • AND - The response only includes profiles that match all of the search keys.

    • OR - The response includes profiles that match at least one of the search keys.

    The OR relationship is the default behavior if this parameter is not included in the request.

Raises:

Source code in docs_src/capo_customer_profiles/_services/async_customer_profiles.py
async def search_profiles(
    self,
    domain_name: "capo_customer_profiles.types.name.name",
    key_name: "capo_customer_profiles.types.name.name",
    values: "capo_customer_profiles.types.request_value_list.requestValueList",
    *,
    config_overrides: Optional[AsyncCustomerProfilesClientConfig] = None,
    next_token: Optional["capo_customer_profiles.types.token.token"] = None,
    max_results: Optional[
        "capo_customer_profiles.types.max_size100.maxSize100"
    ] = None,
    additional_search_keys: Optional[
        "capo_customer_profiles.types.additional_search_keys_list.additionalSearchKeysList"
    ] = None,
    logical_operator: Optional[
        "capo_customer_profiles.types.logical_operator.logicalOperator"
    ] = None,
) -> "capo_customer_profiles.types.search_profiles_response.SearchProfilesResponse":
    """<p>Searches for profiles within a specific domain using one or more predefined search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined search keys. A search key is a data type pair that consists of a <code>KeyName</code> and <code>Values</code> list.</p> <p>This operation supports searching for profiles with a minimum of 1 key-value(s) pair and up to 5 key-value(s) pairs using either <code>AND</code> or <code>OR</code> logic.</p>

    Args:
        next_token: <p>The pagination token from the previous SearchProfiles API call.</p>
        max_results: <p>The maximum number of objects returned per page.</p> <p>The default is 20 if this parameter is not included in the request.</p>
        domain_name: <p>The unique name of the domain.</p>
        key_name: <p>A searchable identifier of a customer profile. The predefined keys you can use to search include: _account, _profileId, _assetId, _caseId, _orderId, _fullName, _phone, _email, _ctrContactId, _marketoLeadId, _salesforceAccountId, _salesforceContactId, _salesforceAssetId, _zendeskUserId, _zendeskExternalId, _zendeskTicketId, _serviceNowSystemId, _serviceNowIncidentId, _segmentUserId, _shopifyCustomerId, _shopifyOrderId.</p>
        values: <p>A list of key values.</p>
        additional_search_keys: <p>A list of <code>AdditionalSearchKey</code> objects that are each searchable identifiers of a profile. Each <code>AdditionalSearchKey</code> object contains a <code>KeyName</code> and a list of <code>Values</code> associated with that specific key (i.e., a key-value(s) pair). These additional search keys will be used in conjunction with the <code>LogicalOperator</code> and the required <code>KeyName</code> and <code>Values</code> parameters to search for profiles that satisfy the search criteria. </p>
        logical_operator: <p>Relationship between all specified search keys that will be used to search for profiles. This includes the required <code>KeyName</code> and <code>Values</code> parameters as well as any key-value(s) pairs specified in the <code>AdditionalSearchKeys</code> list.</p> <p>This parameter influences which profiles will be returned in the response in the following manner:</p> <ul> <li> <p> <code>AND</code> - The response only includes profiles that match all of the search keys.</p> </li> <li> <p> <code>OR</code> - The response includes profiles that match at least one of the search keys.</p> </li> </ul> <p>The <code>OR</code> relationship is the default behavior if this parameter is not included in the request.</p>

    Raises:
        capo_customer_profiles.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_customer_profiles.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_customer_profiles.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred.</p>
        capo_customer_profiles.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist, or access was denied.</p>
        capo_customer_profiles.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_customer_profiles.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_customer_profiles.types.search_profiles_request.SearchProfilesRequest]",
    ) -> AsyncOperationResponse[
        "capo_customer_profiles.types.search_profiles_response.SearchProfilesResponse"
    ]:
        import capo_customer_profiles._operations.customer_profiles_20200815.search_profiles

        (
            output,
            http_response,
        ) = await capo_customer_profiles._operations.customer_profiles_20200815.search_profiles.async_search_profiles(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_customer_profiles.types.search_profiles_response.SearchProfilesResponse",
    ) -> dict[str, Any]:
        import capo_customer_profiles.types.search_profiles_response

        return (
            capo_customer_profiles.types.search_profiles_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SearchProfiles", redact_output=_redact_output),
    )
    input_: capo_customer_profiles.types.search_profiles_request.SearchProfilesRequest = {
        "domain_name": domain_name,
        "key_name": key_name,
        "values": values,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if additional_search_keys is not None:
        input_["additional_search_keys"] = additional_search_keys
    if logical_operator is not None:
        input_["logical_operator"] = logical_operator

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output