Forum Discussion
MichaelD so is there any way to achieve that goal?
as thilo pointed out, there's a leaderboard, but the documenation is quite unclear.
Thank you very much!
- MichaelD11 years agoLithium Alumni (Retired)A product is not required to have associated rating information. This is the reason that the /restapi/vc/products/all was implemented such that all products would be returned independent of the rating.
Once you have obtained the id for a product you will be able to call the endpoint /restapi/vc/products/id/34/ratings/key/key to obtain the rating information for the product.
Presently the rest API does not provide a single endpoint for obtaining a list of products ordered by ratings. But the two endpoints discussed here can be used to build such a list.
I hope this helps.- petermanser11 years agoAce
MichaelD gosh! as we're having something around 200k products, this would mean we'd have to more than 200k calls to retrieve the top 10 products? (case: live request - no caching)
Thanks for your FAST replies, very helpful.
- MichaelD11 years agoLithium Alumni (Retired)
I think the ideal solution would be to provide a rest endpoint that returns a sorted list of all products that have an assigned rating.
I have documented the request and forwarded it to our product management team for consideration as a future feature enhancement.
Thank you for bringing our attention to this issue.
- thilo11 years agoMentor
Thanks a lot MichaelD for your support! A simple route to achieve this would be awesome.
The question still remains what the route "restapi/vc/ratings/key/key/ratings/leaderboard" is for, and why it isn't working? As the documentation suggests exactly to be the route we were looking for it might be helpful to adjust the documentation of this API call.
- ChhamaJ11 years agoKhoros Staff
"restapi/vc/ratings/key/key/ratings/leaderboard" is for listing all rated targets (forum posts, knowledge base articles, products, ideas, contests) and their average rating and count. The default sort order is by average.
For getting all products, the key is review_ratings. So the call should look like
restapi/vc/ratings/key/review_ratings/ratings/leaderboard
Also, you would get a 303 only if Ratings is not enabled on your community. The call should work and return the correct result. If it doesn't, feel free to message me with the call you are using.
Hope this helps.
Regards,
Chhama
Related Content
- 3 months ago
- 6 months ago