Content
Generate document
This method generates the document that is defined for the provided slug. Inserts are processed.
SCHEMA_SERVICE_SCHEMA_READ
permission from the Schema group.Declared In:
Headers/SNRContent.h
Related To:
Document
Class:
Content
Declaration:
static func generateDocument(slug: String, success: ((Document) -> Void), failure: ((ApiError) -> Void)) -> Void
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
slug | String | yes | - | Slug of the document |
success | ((Document) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
failure | ((SNRApiError]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
Return Value: No value is returned.
Example:
let slug = "similar"
Content.generateDocument(slug: slug, success: { document in
// success
}) { error in
// failure
}
Get recommendations (v2)
This method generates recommendations that are defined for the options provided.
SCHEMA_SERVICE_SCHEMA_READ
permission from the Schema group.Declared In:
Headers/SNRContent.h
Related To:
RecommendationOptions
RecommendationResponse
Class:
Content
Declaration:
static func getRecommendationsV2(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((ApiError) -> Void)) -> Void
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
options | RecommendationOptions | yes | - | Options for recommendations |
success | ((RecommendationResponse) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
failure | ((SNRApiError]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
let options: RecommendationOptions = RecommendationOptions()
options.slug = "similar"
options.productID = "1"
Content.getRecommendationsV2(options: options, success: { (recommendationResponse) in
// success
}) { (error) in
// failure
}
Generate screen view
This method generates a customer’s highest-priority screen view campaign from the feed with the provided feed slug.
SCHEMA_SERVICE_SCHEMA_READ
permission from the Schema group.Declared In:
Headers/SNRContent.h
Related To:
ScreenViewResponse
Class:
Content
Declaration:
static func generateScreenView(feedSlug: String, success: ((ScreenViewResponse) -> Void), failure: ((ApiError) -> Void)) -> Void
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
feedSlug | String | yes | - | Identifies a specific screen view |
success | ((ScreenViewResponse) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
failure | ((SNRApiError]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Deprecated methods
Get document
This method generates the document that is defined for the provided slug.
SCHEMA_SERVICE_DOCUMENT_READ
permission from the Document group.Declared In:
Headers/SNRContent.h
Class:
Content
Declaration:
static func getDocument(slug: String, success: (([AnyHashable: Any]) -> Void), failure: ((ApiError) -> Void)) -> Void
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
slug | String | yes | - | Slug of the document |
success | (([AnyHashable: Any]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
failure | ((SNRApiError]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
Return Value: No value is returned.
Example:
let slug = "similar"
Content.getDocument(slug: slug, success: { document in
// success
}) { error in
// failure
}
Get documents
This method generates documents that are defined for parameters provided in the query object.
SCHEMA_SERVICE_DOCUMENT_READ
permission from the Document group.Declared In:
Headers/SNRContent.h
Related To:
DocumentsApiQuery
Class:
Content
Declaration:
static func getDocuments(apiQuery: DocumentsApiQuery, success: (([[AnyHashable: Any]]) -> Void), failure: ((ApiError) -> Void)) -> Void
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
apiQuery | DocumentsApiQuery | yes | - | Object that stores all query parameters |
success | (([[AnyHashable: Any]]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
failure | ((SNRApiError]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Get recommendations
This method generates recommendations that are defined for the options provided.
SCHEMA_SERVICE_DOCUMENT_READ
permission from the Document group.Declared In:
Headers/SNRContent.h
Related To:
RecommendationOptions
RecommendationResponse
Class:
Content
Declaration:
static func getRecommendations(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((ApiError) -> Void)) -> Void
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
options | RecommendationOptions | yes | - | Options for recommendations |
success | ((RecommendationResponse) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
failure | ((SNRApiError]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
let options: RecommendationOptions = RecommendationOptions()
options.slug = "similar"
options.productID = "1"
Content.getRecommendations(options: options, success: { (recommendationResponse) in
// success
}) { (error) in
// failure
}
Get screen view
This method generates the customer’s highest-priority screen view campaign.
SCHEMA_SERVICE_SCHEMA_READ
permission from the Schema group.Declared In:
Headers/SNRContent.h
Related To:
ScreenViewResponse
Class:
Content
Declaration:
static func getScreenView(success: ((ScreenViewResponse) -> Void), failure: ((ApiError) -> Void)) -> Void
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
success | ((ScreenViewResponse) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
failure | ((SNRApiError]) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
Return Value:
No value is returned.