Forum Discussion

franpp's avatar
franpp
Guide
12 years ago

Is there an API request URL to get products sorted by rating?

I need to get products sorted by rating, but can't find the correct API request for this in the API documentation. Is there any API request that returns this, or there is any sorting option for products/all/products?

13 Replies

  • MichaelD's avatar
    MichaelD
    Lithium Alumni (Retired)
    11 years ago

    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.

  • thilo's avatar
    thilo
    Mentor
    11 years ago

    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.

  • ChhamaJ's avatar
    ChhamaJ
    Khoros Staff
    11 years ago

    thilo 

    "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