Recommendations and Documents
Recommendations
RecommendationRequestBody
Class responsible for creating a recommendation request.
Declared In:
com.synerise.sdk.content.model.recommendation.RecommendationRequestBody
Declaration:
public final class RecommendationRequestBody implements Serializable
Properties:
| Property | Type | Optional | Default | Description |
|---|---|---|---|---|
| productId | String | no | - | Item identifier of the context item |
| itemsIds | ArrayList |
no | - | List of item identifiers, used for multiple item context |
| itemsExcluded | ArrayList |
no | Items that will be excluded from the generated recommendations | |
| additionalFilters | String | no | Additional filters. These are merged with the campaign’s own filters according to the logic in filtersJoiner | |
| filtersJoiner | String | no | Defines the logic of merging additionalFilters with the campaign’s existing filters | |
| additionalElasticFilters | String | no | Additional elastic filters. These are merged with the campaign’s own elastic filters according to the logic in elasticFiltersJoiner | |
| elasticFiltersJoiner | String | no | Defines the logic of merging additionalElasticFilters with the campaign’s existing elastic filters | |
| displayAttribute | ArrayList |
no | An array of item attributes which value will be returned in a recommendation response | |
| includeContextItems | Boolean | no | When true, the recommendation response will include context item metadata |
Initializers:
There are no initializers.
Methods:
Setter for productId
public RecommendationRequestBody setProductId(String productId)Setter for itemsIds
public RecommendationRequestBody setItemsIds(ArrayList<String> itemsIds)RecommendationResponse
Class responsible for receiving recommendations.
Declared In:
com.synerise.sdk.content.model.recommendation.RecommendationResponse
Declaration:
public class RecommendationResponse
Properties:
| Property | Type | Optional | Default | Description |
|---|---|---|---|---|
| recommended | List<Recommendation> | no | - | List of recommendations |
| extras | RecommendationResponseExtras | yes | - | Additional details of the recommendation |
| name | String | no | - | Name of the recommendation campaign |
| campaignHash | String | no | - | Hash (UUID) of the recommendation campaign |
| campaignId | String | no | - | ID of the recommendation campaign |
| correlationId | String | no | - | Recommendation’s correlation ID. It can be added to a recommendation.click event to associate it with the recommendation request |
| schema | String | no | - | Schema of the document which contains the recommendation |
| slug | String | no | - | Slug of the document |
| uuid | String | no | - | UUID of the document |
Initializers:
There are no initializers.
Methods:
This method retrieves a recommendation schema.
public String getSchema()This method retrieves the value of the slug parameter.
public String getSlug()This method retrieves the value of the UUID parameter.
public String getUuid()This method retrieves a list of recommendations.
public List<Recommendation> getRecommendationsV2()This method retrieves the value of the campaignHash parameter.
public String getCampaignHash()This method retrieves the value of the campaignId parameter.
public String getCampaignId()Recommendation
Class model for a recommendation.
Declared In:
com.synerise.sdk.content.model.recommendation.Recommendation
Declaration:
public class Recommendation extends BaseModel
Properties:
| Property | Type | Optional | Default | Description |
|---|---|---|---|---|
| itemId | String | no | - | Product’s GTIN |
| feed | HashMap<String, Object> | no | - | Product’s recommendation attributes |
Initializers:
There are no initializers.
Methods:
There are only getters and setters for the above properties.
RecommendationAttribute
Class model for custom attributes.
Declared In:
com.synerise.sdk.content.model.recommendation.RecommendationAtribute
Declaration:
public class RecommendationAtribute
Properties:
| Property | Type | Optional | Default | Description |
|---|---|---|---|---|
| name | String | no | - | Attribute name |
| type | String | no | - | Attribute type |
| value | String | no | - | Attribute value |
Initializers:
There are no initializers.
Methods:
There are only getters and setters for the above properties.
Documents
DocumentApiQuery
Class responsible for creating a query to the Documents API.
Declared In:
com.synerise.sdk.content.model.DocumentApiQuery
Declaration:
public class DocumentApiQuery
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| slug | String | no | Unique identifier of a document |
Properties used only if the document includes a recommendation insert:
| Property | Type | Optional | Description |
|---|---|---|---|
| productId | String | no | Item identifier of the context item |
| itemsIds | ArrayList |
no | List of item identifiers, used for multiple item context |
| itemsExcluded | ArrayList |
no | Items that will be excluded from the generated recommendations |
| additionalFilters | String | no | Additional filters. These are merged with the campaign’s own filters according to the logic in filtersJoiner |
| filtersJoiner | String | no | Defines the logic of merging additionalFilters with the campaign’s existing filters |
| additionalElasticFilters | String | no | Additional elastic filters. These are merged with the campaign’s own elastic filters according to the logic in elasticFiltersJoiner |
| elasticFiltersJoiner | String | no | Defines the logic of merging additionalElasticFilters with the campaign’s existing elastic filters |
| displayAttribute | ArrayList |
no | An array of item attributes which value will be returned in a recommendation response |
| includeContextItems | Boolean | no | When true, the recommendation response will include context item metadata |
| params | HashMap<String, Object> | yes | Additional parameters to pass for Inserts in the document. For example, if the insert is {{ foo }}, you need to pass the value of foo |
Initializers:
There is a constructor.
public DocumentApiQuery(String feedSlug)Methods:
Setter for feedSlug
public void setFeedSlug(String feedSlug)Setter for additionalFilters
public DocumentApiQuery setAdditionalFilters(String additionalFilters)Setter for itemsExcluded
public DocumentApiQuery setItemsExcluded(ArrayList<String> itemsExcluded)Setter for filtersJoiner
public DocumentApiQuery setFiltersJoiner(FiltersJoinerRule filtersJoiner)Setter for additionalElasticFilters
public DocumentApiQuery setAdditionalElasticFilters(String additionalElasticFilters)Setter for elasticFiltersJoiner
public DocumentApiQuery setElasticFiltersJoiner(FiltersJoinerRule elasticFiltersJoiner)Setter for displayAttributes
public DocumentApiQuery setDisplayAttributes(ArrayList<String> displayAttribute)Setter for includeContextItems
public DocumentApiQuery setIncludeContextItems(Boolean includeContextItems)Setter for itemsIds
public DocumentApiQuery setItemsIds(ArrayList<String> itemsIds)Setter for productId
public DocumentApiQuery setProductId(String productId)Document
Declared In:
com.synerise.sdk.content.model.document
Declaration:
public class Document
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| uuid | String | no | Document’s identifier (UUID) |
| slug | String | no | Document’s slug |
| schema | String | no | Document’s schema type |
| content | [AnyHashable: Any] | no | Document’s content |
Initializers:
There are no initializers.
Methods:
There are only getters for the above properties.
Removed symbols
DocumentsApiQuery
The object to set parameters easily for fetching documents from API.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.5.10 | 3.5.1 | 0.9.10 | 0.2.0 |
| Deprecated in: | 4.13.0 | 5.5.0 | 0.17.0 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |
Class responsible for creating a query to the Documents API.
Declared In:
com.synerise.sdk.content.model.DocumentsApiQuery
Declaration:
public class DocumentsApiQuery
Properties:
| Property | Type | Optional | Default | Description |
|---|---|---|---|---|
| type | DocumentsApiQueryType | yes | - | Document’s query type |
| typeValue | String | yes | - | Document’s query type value |
| version | String | yes | - | Document version |
Initializers:
There are no initializers.
Methods:
This method sets query parameters.
public void setDocumentQueryParameters(DocumentsApiQueryType type, String typeValue)This method sets a document version.
public void setVersion(String version)DocumentsApiQueryType
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 3.5.10 | 3.5.1 | 0.9.10 | 0.2.0 |
| Deprecated in: | 4.13.0 | 5.5.0 | 0.17.0 | n/a |
| Removed in: | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |
This enum contains values for the Documents API query type.
Declared In:
com.synerise.sdk.content.model.DocumentsApiQueryType
Declaration:
public enum DocumentsApiQueryType
Values:
| Property | Value | Description |
|---|---|---|
| SCHEMA | “by-schema” | Query type |
Methods:
Get by path type.
public static DocumentsApiQueryType getByPathType(String type)