Skip to content

Retrieves recommendations for a profile in a specific domain

Description

Retrieves recommendations for a profile in a specific domain. The profile is identified using a search key, which consists of a KeyName and a KeyValues list. The KeyName can be a predefined key (for example, _profileId, _phone, _email) or a custom-defined key.

The search key must match exactly one profile. If no profile matches the search key, the operation returns a ResourceNotFoundException. If more than one profile matches the search key, the operation returns a BadRequestException. You can use the SearchProfiles API to review the matching profiles.

Usage

customerprofiles_search_recommendations(DomainName, KeyName, KeyValues,
  Recommender, CandidateIds, Context, Diversity, Metadata,
  MaxRecommendations)

Arguments

  • DomainName

[required] The unique name of the domain.

  • KeyName

[required] A searchable identifier of a customer profile. You can use a predefined key, such as _profileId, _phone, or _email, or a custom-defined key.

  • KeyValues

[required] A list of key values. Provide one value for each field of the search key.

  • Recommender

[required] The recommender used to generate the recommendations.

  • CandidateIds

A list of item IDs to rank for the user. Use this when you want to re-rank a specific set of items rather than getting recommendations from the full item catalog. Required for personalized-ranking use cases.

  • Context

The contextual metadata used to provide dynamic runtime information to tailor recommendations.

  • Diversity

Runtime diversity configuration for this request. Enables diversity-aware recommendations and optionally supplies values for placeholder-based diversity caps configured on the recommender.

  • Metadata

Configuration for metadata to include in recommendation responses.

  • MaxRecommendations

The maximum number of recommendations to return. The default value is 5.

Value

A list with the following syntax:

list(
  ProfileId = "string",
  Recommendations = list(
    list(
      CatalogItem = list(
        Id = "string",
        Name = "string",
        Code = "string",
        Type = "string",
        Category = "string",
        Description = "string",
        AdditionalInformation = "string",
        ImageLink = "string",
        Link = "string",
        CreatedAt = as.POSIXct(
          "2015-01-01"
        ),
        UpdatedAt = as.POSIXct(
          "2015-01-01"
        ),
        Price = "string",
        Attributes = list(
          "string"
        )
      ),
      Score = 123.0
    )
  )
)

Request syntax

svc$search_recommendations(
  DomainName = "string",
  KeyName = "string",
  KeyValues = list(
    "string"
  ),
  Recommender = list(
    Name = "string",
    Filters = list(
      list(
        Name = "string",
        Values = list(
          "string"
        )
      )
    ),
    PromotionalFilters = list(
      list(
        Name = "string",
        Values = list(
          "string"
        ),
        PromotionName = "string",
        PercentPromotedItems = 123
      )
    )
  ),
  CandidateIds = list(
    "string"
  ),
  Context = list(
    "string"
  ),
  Diversity = list(
    Enabled = TRUE|FALSE,
    Values = list(
      123
    )
  ),
  Metadata = list(
    Columns = list(
      "string"
    )
  ),
  MaxRecommendations = 123
)