Content

Get Document


Gets a document that is defined for the provided slug.

Declared In

SNRContent.h

Method Name

Content.getDocument(slug:success:failure:)

Declaration

func getDocument(slug: String, success: (([AnyHashable: Any]) -> ()), failure: ((Error) -> ())) -> Void

Parameters

Parameter Type Mandatory Default Description
slug String yes - Identifies a specific document
success Block/Closure no - Block/closure to be executed when the operation finishes successfully
failure Block/Closure no - Block/closure to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let slug = "similar"
Content.getDocument(slug: slug, success: { document in
	// success
}) { error in
	// failure
}

Get Recommendations


Gets recommendations that are defined for the provided options.

Declared In

SNRContent.h

SNRRecommendationOptions.h

Method Name

Content.getDocument(slug:success:failure:)

Declaration

func getRecommendations(options: RecommendationOptions, success: (RecommendationResponse) -> ()), failure: ((Error) -> ())) -> Void

Parameters

Parameter Type Mandatory Default Description
options SNRRecommendationOptions yes - Options for recommendations
success Block/Closure no - Block/closure to be executed when the operation finishes successfully
failure Block/Closure no - Block/closure to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Example

let options: RecommendationOptions = RecommendationOptions()
options.slug = "similar"
options.productID = "1"
Content.getRecommendations(options: options, success: { (recommendationResponse) in
	// success
}) { (error) in
	// failure
}
😕

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.