Forum Discussion

irach15's avatar
irach15
Maven
5 years ago

Is it any way to remove/delete a star rating from the post?

Hey,

we are getting requests from our users to remove their star ratings they've posted accidentally.

As a community moderator and Admin, I don't see any possibility to remove a star rating without just to downgrade it to '1' instead of '5'. 

I've looked through the post and found last year idea:

https://community.khoros.com/t5/Khoros-Communities-Ideas/Ideas-Board-Various-Suggestions/idc-p/610988#M18819

Does anyone knows if it's even possible for the user to remove/delete their own rating?

is it any way for Admins to remove/delete any specific rating?

5 Replies

  • TedV's avatar
    TedV
    Khoros Alumni (Retired)
    5 years ago

    Hi irach15 ,

    If you have found the answer to be satisfactory, would you mind marking it as as the accepted solution?

     

    Thanks!

  • irach15's avatar
    irach15
    Maven
    5 years ago

    VarunGrazitti 

    hmmm... is it to delete one specific rating that was given by a user or delete all ratings for the message?

    I'm a bit confused here,

    the code snippet would help πŸ™‚

    it should be:

    delete a rating from a specific user on a specific message

  • VarunGrazitti TedV 

    not marking yet,

    because I'm having the issue to do cUrl with SSO signin.

    How can I find SSO token to get a session key?

    curl -X \
        POST https://[COMMUNITY DOMAIN]/restapi/vc/authentication/sessions/login \
        -H 'content-type: application/x-www-form-urlencoded' \
        -d 'sso.authentication_token': 'some-token-here'

     looking for any help here.

    curl -X DELETE \
        https://[COMMUNITY-DOMAIN]/api/2.0/ratings/20 \
        -H 'Authorization: Bearer [TOKEN]' \
        -H 'client-id: [CLIENT-ID]' \

     in order to do call  above

    what are Bearer [TOKEN] and [CLIENT-ID]??

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)
    5 years ago

    HI irach15 

    The DELETE request will delete the single, specified rating, not all ratings. Each rating given has a unique ID. 

    To get the rating IDs and the associated user that gave each rating, you'd do something like this, where you constrain the query by message.id.

    SELECT id, user FROM ratings WHERE message.id = '58'

     

    Then you pass that rating ID (to delete that specific rating) to the /ratings/{rating-id} endpoint as VarunGrazitti demonstrated in his earlier post.

    curl -X DELETE \
        https://[COMMUNITY-DOMAIN]/api/2.0/ratings/20 \
        -H 'li-api-session-key: [SESSION-KEY]'