0

i would like to rate items via rest API. and i would like get user specific ratings. so if the user rated an item with 5 stars i want to see 5 stars somewhere in XML from rest API. By default i receive a XML including RatingCount and AverageRating. (if there is at least one Rating) But how to get my own rating to display in a UI And how to rate if there is no Value to change? I searched for hours, but can t find any real hint. is there even a way to do this via rest? I am using C#.

0

Here is JSOM solution for your reference(get rated users and the score):

<script type="text/javascript">
    SP.SOD.executeOrDelayUntilScriptLoaded(CustomJS, 'sp.js');
    function CustomJS() {
        var ctx = SP.ClientContext.get_current();
        var web = ctx.get_web();
        var list = web.get_lists().getByTitle("Documents");
        var item = list.getItemById(1);
        ctx.load(item);
        ctx.executeQueryAsync(function (sender, args) {
            var _RatedBy = item.get_item('RatedBy');
            var _Ratings=item.get_item('Ratings')
        })        
    }
   </script>

For rating, you cold check the similar thread below.

https://social.msdn.microsoft.com/Forums/office/en-US/3aec1b3d-3bef-4e9d-b6d6-70ecc6375aaf/set-rating-of-a-host-web-list-column-using-sharepoint-hosted-app?forum=appsforsharepoint

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.