Content

Generate document


This method generates the document that is defined for the provided slug. Inserts are processed.

Note: The API key must have the 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.

Note: The API key must have the 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.

Note: The API key must have the 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.

Note: The API key must have the SCHEMA_SERVICE_DOCUMENT_READ permission from the Document group.
Note: This method was deprecated in SDK version 4.13.0.

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.

Note: The API key must have the SCHEMA_SERVICE_DOCUMENT_READ permission from the Document group.
Note: This method was deprecated in SDK version 4.13.0.

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.

Note: The API key must have the SCHEMA_SERVICE_DOCUMENT_READ permission from the Document group.
Note: This method was deprecated in SDK version 4.13.0.

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.

Note: The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.
Note: This method was deprecated in SDK version 4.13.0.

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.

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker