Content

Get Document


Gets a document that is defined for the provided slug.

Declared In

SNRContent.h

Class Name

Content

Method Name

getDocument(slug:success:failure:)

Declaration

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

Parameters

Parameter Type Mandatory Default Description
slug String yes - Identifies a specific document
success (([AnyHashable: Any]) -> Void) yes - Closure/block to be executed when the operation finishes successfully
failure ((ApiError) -> Void) yes - Closure/block 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 Documents


Gets a number of documents at once.

Declared In

SNRContent.h

DocumentsApiQuery

Class Name

Content

Method Name

getDocuments(apiQuery:success:failure:)

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 finishes successfully
failure ((ApiError) -> Void) yes - Closure/block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

Get Recommendations


Gets recommendations that are defined for the provided options.

Declared In

SNRContent.h

RecommendationOptions
RecommendationResponse

Class Name

Content

Method Name

getRecommendations(options:success:failure:)

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 finishes successfully
failure ((ApiError) -> Void) yes - Closure/block 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
}

Get Screen View


Gets a document that is defined for the provided slug.

Declared In

SNRContent.h

ScreenViewResponse

Class Name

Content

Method Name

getScreenView(success:failure:)

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 finishes successfully
failure ((ApiError) -> Void) yes - Closure/block to be executed when the operation finishes unsuccessfully

Return Value

There is no return value.

😕

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.