Forum Discussion

iahiqosolutions's avatar
12 years ago

Time at which the user gave the kudo via rest API.

Hello guys.

 

I need to get time at which the user gave the kudo via rest API. 

I have found object KudoUserWeightAndTime (KudoUserWeightAndTime.html), which contains Time field: "date_time - the time at which the user gave the kudo" according to API docs.

I also found that API call like

http://community.lithium.com/community-name/restapi/vc/messages/id/1271/kudos/givers/recent

should return this object.

 

But I don't see any Time field in response. How can I get the time at which the user gave the kudo via rest API?

 

There is a response of call to http://community.lithium.com/community-name/restapi/vc/messages/id/1271/kudos/givers/recent

<response status="success">

   <users>

       <user mixins="kudos" type="user" href="/users/id/15">

          <id type="int">15</id>

          <registered type="boolean">true</registered>

          <deleted type="boolean">false</deleted>

          <login type="string">userlogin</login>

          <anonymous type="boolean">false</anonymous>

          <email type="string">user@mail.com</email>

          <last_visit_time type="date_time">2013-02-25T15:20:51+00:00</last_visit_time>

          <registration_time type="date_time">2013-01-31T02:41:18+00:00</registration_time>

          <average_message_rating type="float">0.0</average_message_rating>

          <average_rating type="float">0.0</average_rating>

          <banned type="boolean">false</banned>

          <mixin>

             <kudos>

                <weight type="int">1</weight>

             </kudos>

          </mixin>

       </user>

     </users>

</response>

  • ChhamaJ's avatar
    ChhamaJ
    12 years ago

    I could not find a link, but this is what I could find in the code
    Query Parameter restapi.response_style

    If a request specifies the parameter restapi.response_style, the response will include/exclude specific types of attributes. Possible values include
    Possible Value     Description
    data     Only the data is included in the response
    view     View representations of the data are also included in the response.

    orbit     Response is formatted as required by orbit service

    cic        Fields required by the CIC

    all         Response contains all fields that have been added as part of the response,including those that have been added after the reponse was first added to the Rest Api.

  • Inactive User's avatar
    Inactive User

    This is cool but we are trying to get a user's kudos, regardless of a message. (Think a recent activity module.) If you use a call like '

    users/id/43/kudos/given/messages/recent?restapi.response_style=all, it doesn't return the mixin data with the time the user kudoed, just a list of the message data for the posts the user kudoed. Is there a way to get that timestamp included in this result as well?
  • VenkS's avatar
    VenkS
    Lithium Alumni (Retired)

    I believe the last_visit_time is the time that the kudos was given. Could you confirm if that is true for you?