Forum Discussion
Thank you for your quick answer !
I thought that a "Me Too" could be a achieved by creating a Rating with the following rest call :
rest("/messages/id/MESSAGE_ID/ratings/key/question_metoo/ratings/add?rating.value=0.0")
As for the non-contract component, we don't need the actual code per se, but the knowledge of what parameter to pass to the component for it to apply to a given Question for example. We would be perfectly happy with just calling the non-contract component with :
<component id="ratings.widget.rating-enum-display" ratingSystemRef="conv:question_metoo"/>
and adding a parameter for the widget to recognize what message to apply the "Me Too" to.
Do you think it is possible ?
Thanks again for your help :)
Hello,
Currently there is no way to directly parameterize the ratings.widget.rating-enum-display component for a specific Question. This component will attempt to get the object it is rating from its context. If used in the context of a Question component, then it will give the me too rating to the Question. If not used within a component that has a "ratable object" then it will attempt to get of the ratable item from the URL. Since you plan to use this on the Q&A main page, there will not be an ID for a Question in the URL path, and there is no simple way to add one that will be picked up by this component.
I think a good improvement for the existing component would be to allow the parameterization of the ratable object. You might consider submitting this as an Idea or as a services engagement. Otherwise I think you would need to try and replicate the functionality using the REST API.
- VincentGabou11 years agoGuide
Hello Adam,
Thank you very much for these precisions ! I think I will indeed submit an Idea to make this "Me Too" a little bit more reusable.
In the meantime as you suggested, I think I will have to replicate the behaviour by hand, that is, redirect to the login page if the user is not connected (with a fallback_url), and make a rest call to add a Me Too if the user is already logged in.
That said, and juste to be sure, is the correct API call the one i suggested earlier, i.e. :
rest("/messages/id/MESSAGE_ID/ratings/key/question_metoo/ratings/add?rating.value=0.0")
?
Thanks again for your help :)
- clemlith11 years agoExpert
Hi VincentGabou and AdamA ,
Thanks for sharing your thoughts about this features and its limitations in its current state.
If Vincent try to replicate the behavior of a me too button he has to handle all the logic related to the authentication/registration status.
And as per my understanding there's also the management and the creation of a token which is needed to perfom an action in the platform.
Indeed at the end of every URL holded by a kudo or me too button there is ticket parameter (e.g &ticket=aMivVgLAcKnS_11676)
AdamADo you know if this token / parameter is mandatory ? If yes is there a way to generate it through an api call ?
Best,
Clement
- AdamA11 years agoKhoros Oracle
VincentGabou Yes, the rest call you referenced is the one you would use to give a me too. I believe a value of -1 is what we consider "not helpful" and a value of 1 is considered to be helpful.
Add (or change) the Me Too on a Question:
/messages/id/<message-id>/ratings/key/question_metoo/ratings/add?rating.value=1
Revoke the Me Too on a Question:
/messages/id/<message-id>/ratings/key/question_metoo/ratings/revoke
clemlith If this is used in the context of a custom component, as freemarker code, then the call will be made as the current user. If made via REST over HTTP then you would need to use one of our auth mechanisms to make the call as the current user. One of the mechanisms is to pass a sso.authentication_token along with the request (if you are using SSO). This token can be generated by using a REST call (see links below for more details). Please note that the sso.authentication_token is different that the token (aka ticket) used by the application that you saw in the out-of-the-box UI (ticket=aMivVgLAcKnS_11676). The token used by the out-of-the-box UI is not intended to be used for REST or for customizations. Also, the action links in the OOTB UI are not intended to be used when building customizations, the REST API should be used in those cases.
Auth for Non SSO:
http://community.lithium.com/t5/Single-Sign-On-SSO/Authenticating-via-REST-API-non-SSO/ta-p/61862
Auth for SSO:
https://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?page=authentication#sso
Related Content
- 4 years agoInactive User
- 7 months ago