Content
Get document
This method generates the document that is defined for the provided slug.
SCHEMA_SERVICE_DOCUMENT_READ
permission from the Document group.Declared In:
lib/main/modules/ContentModule.js
Class:
ContentModule
Declaration:
public getDocument(slug: string, onSuccess: (document: Object) => void, onError: (error: Error) => void)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
slug | string | yes | - | Name of the slug |
onSuccess | Function | no | - | Function to be executed when the operation is completed successfully |
onError | Function | no | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
Synerise.Content.getDocument('slugName', function(document) {
//success
}, function(error) {
//failure
})
Get documents
This method generates documents that are defined for parameters provided in the query object.
SCHEMA_SERVICE_DOCUMENT_READ
permission from the Document group.Declared In:
lib/main/modules/ContentModule.js
Related To:
DocumentsApiQuery
Class:
ContentModule
Declaration:
public getDocuments(apiQuery: DocumentsApiQuery, onSuccess: (documents: Array<Object>) => void, onError: (error: Error) => void)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
documentsApiQuery | DocumentsApiQuery | yes | - | DocumentsApiQuery object responsible for storing all query parameters |
onSuccess | Function | no | - | Function to be executed when the operation is completed successfully |
onError | Function | no | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
let documentsApiQuery = new DocumentsApiQuery(DocumentsApiQueryType.SCHEMA, 'type', '1.0.0')
Synerise.Content.getDocuments(documentsApiQuery, function(documents) {
//success
}, function(error) {
//failure
})
Get recommendations
This method generates recommendations that are defined for the options provided.
SCHEMA_SERVICE_DOCUMENT_READ
permission from the Document group.Declared In:
lib/main/modules/ContentModule.js
Related To:
RecommendationOptions
Class:
ContentModule
Declaration:
public getRecommendations(options: RecommendationOptions, onSuccess: (recommendationResponse: RecommendationResponse) => void, onError: (error: Error) => void)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
recommendationOptions | RecommendationOptions | yes | - | Object for configuration of the options parameters |
onSuccess | Function | no | - | Function to be executed when the operation is completed successfully |
onError | Function | no | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.
Example:
let recommendationOptions = new RecommendationOptions()
recommendationOptions.productID = 'productID'
recommendationOptions.slug = 'slugName'
Synerise.Content.getRecommendations(recommendationOptions, function(recommendationResponse) {
//success
},function(error) {
//failure
});
Get screen View
This method generates the customer’s highest-priority screen view campaign.
SCHEMA_SERVICE_SCHEMA_READ
permission from the Schema group.Declared In:
lib/main/modules/ContentModule.js
Class:
ContentModule
Declaration:
public getScreenView(onSuccess: (screenViewResponse: ScreenViewResponse) => void, onError: (error: Error) => void)
Parameters:
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
onSuccess | Function | no | - | Function to be executed when the operation is completed successfully |
onError | Function | no | - | Function to be executed when the operation is completed with an error |
Return Value:
No value is returned.