Content
Get document
Method that generates the document assigned to a slug.
Declared In
lib/main/modules/ContentModule.js
Method
Synerise.Content.getDocument(slug, onSuccess, onError)
Parameters
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
slug |
string |
yes | - | Name of the slug |
onSuccess |
function |
no | - | Callback function to be executed when the operation finishes successfully |
onError |
function |
no | - | Callback function to be executed when the operation finishes unsuccessfully |
Return Value
There is no return value.
Example
Synerise.Content.getDocument('slugName', function(document) {
//success
}, function(error) {
//failure
})
Get documents
Method that generates all documents assigned to a schema.
Declared In
lib/main/modules/ContentModule.js
Method
Synerise.Content.getDocuments(documentsApiQuery, onSuccess, onError)
Parameters
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
documentsApiQuery |
DocumentsApiQuery |
yes | - | Object for configuration of the query parameters |
onSuccess |
function |
no | - | Callback function to be executed when the operation finishes successfully |
onError |
function |
no | - | Callback function to be executed when the operation finishes unsuccessfully |
Return Value
There is no return value.
Example
let documentsApiQuery = new DocumentsApiQuery(DocumentsApiQueryType.SCHEMA, 'type', '1.0.0')
Synerise.Content.getDocuments(documentsApiQuery, function(documents) {
//success
}, function(error) {
//failure
})
Get recommendations
Method that returns a list of recommendations assigned to a slug.
Declared In
lib/main/modules/ContentModule.js
Method
Synerise.Content.getRecommendations(recommendationOptions, onSuccess, onError)
Parameters
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
recommendationOptions |
RecommendationOptions |
yes | - | Object for configuration of the query parameters |
onSuccess |
function |
no | - | Callback function to be executed when the operation finishes successfully |
onError |
function |
no | - | Callback function to be executed when the operation finishes unsuccessfully |
Return Value
There is no return value.
Example
let recommendationOptions = new RecommendationOptions()
recommendationOptions.productID = 'productID'
recommendationOptions.slug = 'slugName'
Synerise.Content.getRecommendations(recommendationOptions, function(recommendationResponse) {
//success
},function(error) {
//failure
});
Get screen view
Method generating screen view for a customer
Declared In
lib/main/modules/ContentModule.js
Method
Synerise.Content.getScreenView(onSuccess, onError)
Parameters
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
onSuccess |
function |
no | - | Callback function to be executed when the operation finishes successfully |
onError |
function |
no | - | Callback function to be executed when the operation finishes unsuccessfully |
Return Value
There is no return value.