cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can we expose classification attributes with Rest Webservice API

Former Member

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member

This works OOTB as Christoph mentioned. You should specify the fields=FULL parameter when calling the REST API to get products and you should be able to retrieve the classification attributes from the classifications element of your response.

Former Member
0 Likes

Products controller will expose any classification attributes ?

Former Member
0 Likes

Hi Dheekollu, the out-of-the-box electronics storefront based on accelerator does return the classification attributes. You can quickly check that by examining the response to i.e. https://localhost:9002/rest/v2/electronics/products/149243?fields=FULL If that doesn't work for your store, maybe the modifications / customizations break the funcitonality. Also, which Hybris version are you using?

Former Member
0 Likes

we are working on custom get product api as List<ClassificationClassModel> classificationClasses = productModel.getClassificationClasses(); this is not returning result.

christoph_probst
Active Participant
0 Likes

to get the classification information use ClassificationService#getFeatures(productModel)

Former Member
0 Likes

Thank you , there were some issues observed while returning classification attributes due to restrictions , need to verify all restrictions applied.

christoph_probst
Active Participant
0 Likes

would be nice if you specify you problem more specific but for now take a look at the occ layer where products and their classificaiton attributes are exposed.

implementing class can be found in hybris/bin/ext-template/ycommercewebservices/web/src/de/hybris/platform/ycommercewebservices/v2/controller/ProductsController.java