Recommendations and Documents
Recommendations
RecommendationResponse
Declared In:
Headers/SNRRecommendationResponse.h
Related To:
Recommendation
Inherits From:
BaseModel
Declaration:
class RecommendationResponse
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| 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 |
| extras | RecommendationResponseExtras | yes | Additional details of the recommendation |
| 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 |
| items | [Recommendation] | no | List of items in the recommendation |
Recommendation
Declared In:
Headers/SNRRecommendation.h
Related To:
RecommendationResponse
Inherits From:
BaseModel
Declaration:
class Recommendation
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| itemID | String | no | Product’s GTIN |
| attributes | [AnyHashable: Any] | no | Product’s recommendation attributes |
RecommendationOptions
Declared In:
Headers/SNRRecommendationOptions.h
Related To:
RecommendationFiltersJoinerRule
Declaration:
class RecommendationOptions
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| slug | String | no | Unique identifier of a document which includes a recommendation insert |
| productID | String | no | Item identifier of the context item |
| productIDs | [String] | no | List of item identifiers, used for multiple item context |
| itemsExcluded | [String] | 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 | RecommendationFiltersJoinerRule | 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 | RecommendationFiltersJoinerRule | no | Defines the logic of merging additionalElasticFilters with the campaign’s existing elastic filters |
| displayAttribute | [String] | no | An array of item attributes which value will be returned in a recommendation response |
| includeContextItems | Bool | no | When true, the recommendation response will include context item metadata |
RecommendationFiltersJoinerRule
Declared In:
Headers/SNRRecommendationOptions.h
Declaration:
enum RecommendationFiltersJoinerRule: Int {
and,
or,
replace
}
Functions: Converts from RecommendationFiltersJoinerRule to String.
func SNR_RecommendationFiltersJoinerRuleToString(_: RecommendationFiltersJoinerRule) -> String
Documents
DocumentApiQuery
The object to set parameters easily for fetching documents from API.
Declared In:
Headers/SNRDocumentApiQuery.h
Inherits From: NSObject
Declaration:
class DocumentApiQuery: NSObject
Properties:
| Property | Type | Optional | Default | Description |
|---|---|---|---|---|
| slug | String | no | nil | Unique identifier of a document |
Properties used only if the document includes a recommendation insert:
| Property | Type | Optional | Description |
|---|---|---|---|
| productId | String | yes | Item identifier of the context item |
| itemsIds | [String] | yes | List of item identifiers, used for multiple item context |
| itemsExcluded | [String] | yes | Items that will be excluded from the generated recommendations |
| additionalFilters | String | yes | Additional filters. These are merged with the campaign’s own filters according to the logic in filtersJoiner |
| filtersJoiner | RecommendationFiltersJoinerRule | yes | Defines the logic of merging additionalFilters with the campaign’s existing filters |
| additionalElasticFilters | String | yes | Additional elastic filters. These are merged with the campaign’s own elastic filters according to the logic in elasticFiltersJoiner |
| elasticFiltersJoiner | RecommendationFiltersJoinerRule | yes | Defines the logic of merging additionalElasticFilters with the campaign’s existing elastic filters |
| displayAttribute | [String] | yes | An array of item attributes which value will be returned in a recommendation response |
| includeContextItems | Bool | yes | When true, the recommendation response will include context item metadata |
| params | [String: Any] | 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:
init(slug: String)
Document
Declared In:
Headers/SNRDocument.h
Inherits From:
BaseModel
Declaration:
class Document: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| uuid | String | no | Document’s identifier (this parameter was called identifier before version 5.0.0) |
| slug | String | no | Document’s slug |
| schema | String | no | Document’s schema type |
| content | [AnyHashable: Any] | no | Document’s content |
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 |
Declared In:
Headers/SNRDocumentsApiQuery.h
Related To:
DocumentsApiQueryType
Inherits From: NSObject
Declaration:
class DocumentsApiQuery: NSObject
Properties:
| Property | Type | Optional | Default | Description |
|---|---|---|---|---|
| type | DocumentsApiQueryType | no | .bySchema | Query type |
| typeValue | String | no | nil | Value for query type |
| version | String | yes | nil | Specifies the document version |
Initializers:
init(type: DocumentsApiQueryType, value: String)
DocumentsApiQueryType
Declared In:
Headers/SNRDocumentsApiQueryType.h
Declaration:
enum DocumentsApiQueryType: Int {
bySchema
}