Content
Get Document
Gets the document that is defined for the provided slug.
Declared In
SNRContent.h
Class Name
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 documents that are defined for parameters provided in the query object.
Declared In
SNRContent.h
Related To
Class Name
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 options provided.
Declared In
SNRContent.h
Related
RecommendationOptions
RecommendationResponse
Class Name
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 the customer’s highest-priority screen view campaign.
Declared In
SNRContent.h
Related
Class Name
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.