Content

Generate document


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

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.13.0 5.5.0 0.17.0 0.6.0
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
}

Generate document with query parameters


This method generates the document that is defined for the parameters provided in the query object.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.18.0 5.19.0 0.22.0 1.2.0
Note: The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.

Declared In:
Headers/SNRContent.h

Related To:
DocumentApiQuery
Document

Class:
Content

Declaration:

static func generateDocument(apiQuery: DocumentApiQuery, success: ((Document) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters:

Parameter Type Mandatory Default Description
apiQuery DocumentApiQuery yes - Object that stores all query parameters
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.

Get recommendations (v2)


This method generates recommendations that are defined for the options provided.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.13.0 5.5.0 0.17.0 0.6.0
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.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 4.13.0 5.5.0 0.17.0 0.6.0
Note: The API key must have the SCHEMA_SERVICE_SCHEMA_READ permission from the Schema group.

Declared In:
Headers/SNRContent.h

Related To:
ScreenView

Class:
Content

Declaration:

static func generateScreenView(feedSlug: String, success: ((ScreenView) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters:

Parameter Type Mandatory Default Description
feedSlug String yes - Identifies a specific screen view feed
success ((ScreenView) -> 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.

Generate screen view with query parameters


This method generates customer’s highest-priority screen view campaign that is defined for parameters provided in the query object.

Declared In:
Headers/SNRContent.h

Related To:
ScreenViewApiQuery
ScreenView

Class:
Content

Declaration:

static func generateScreenView(apiQuery: ScreenViewApiQuery, success: ((ScreenView) -> Void), failure: ((ApiError) -> Void)) -> Void

Parameters:

Parameter Type Mandatory Default Description
apiQuery ScreenViewApiQuery yes - Object that stores all query parameters
success ((ScreenView) -> 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.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 3.4.8 3.4.2 0.9.10 0.2.0
Deprecated in: 4.13.0 5.5.0 0.17.0 0.6.0
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.

iOS SDK Android SDK React Native SDK Flutter SDK
Introduced in: 3.7.1 3.7.1 0.9.10 0.2.0
Deprecated in: 4.13.0 5.5.0 0.17.0 0.6.0
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