Forum Discussion

iahiqosolutions's avatar
12 years ago

How to get user activity feed by rest api?

Hi folks,

 

As far as I know, user activity feed can be accessed by adding appropriate "Activity Feed" widget to the page in Lithium Studio.
But does anybody know rest api call that has the same functionality(retrieving user activity feed)?

 

 

  • Hey iahiqosolutions,

    There is currently no single rest API that will give you the same functionality.

    However you can get the information with multiple API calls:

    1) users/.../posts/latest
    2) users/.../kudos/given/messages/recent
    3) users/.../kudos/received/messages/recent
    4) tagging/for/users/.../messages/recent

    I know this isn't ideal, but I hope this helps with your use case.

    Yuri
  • YuriK's avatar
    YuriK
    12 years ago

    Hey iahiqosolutinos,

     

    You are correct, the APIs don't currently allow you to get activity log messages.

    APIs 2-4 above should return messages for which the user gave kudos (2), received kudos (3), and tagged (4).

    You should be able to parse most of the information (like message name, user that wrote the message) that is contained within the messages in your example from the message objects in each of the lists.

    The only item that you can't get via this method is the timestamp of the actual action. Let me see if there's any other way to get the timestamp information for the kudos/tagging events, but at first glance, it doesn't look like there is currently a way to get this information via the APIs.

     

    Yuri

6 Replies

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago
    Hey iahiqosolutions,

    There is currently no single rest API that will give you the same functionality.

    However you can get the information with multiple API calls:

    1) users/.../posts/latest
    2) users/.../kudos/given/messages/recent
    3) users/.../kudos/received/messages/recent
    4) tagging/for/users/.../messages/recent

    I know this isn't ideal, but I hope this helps with your use case.

    Yuri
  • Hi YuriK,

     

    First of all, thank you for your response!

    But unfortunately, your solution is not cover my user case.

    For example, I guess that I cannot receive the following messages via REST API:

     

    • Give kudo
    • Receive kudo
    • Tag message

     

    Example:

     

     

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago

    Hey iahiqosolutinos,

     

    You are correct, the APIs don't currently allow you to get activity log messages.

    APIs 2-4 above should return messages for which the user gave kudos (2), received kudos (3), and tagged (4).

    You should be able to parse most of the information (like message name, user that wrote the message) that is contained within the messages in your example from the message objects in each of the lists.

    The only item that you can't get via this method is the timestamp of the actual action. Let me see if there's any other way to get the timestamp information for the kudos/tagging events, but at first glance, it doesn't look like there is currently a way to get this information via the APIs.

     

    Yuri

  • cblown's avatar
    cblown
    Boss
    12 years ago

    Interested in getting this type of time data for user actions? Any follow up YuriK?

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago

    Hey Chris and iahiqosolutions,

    See Chhama's response below :smileyhappy:

    Thank you,

    Yuri