Content


Get document


Method generating 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 generating 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 returning 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
});
😕

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.