Forum Discussion

cgmcconnell's avatar
9 years ago

How to retrieve recently updated messages using the Community API v2

Hi,

 

I am migrating from Lithium Community API v1 to v2 and need to make REST HTTP calls to get the list of messages (and replies) recently updated or posted on the community. I am able to get the recently posted message and replies list by using this query:

SELECT * FROM messages WHERE post_time > 2016-04-18T10:04:30-08:00 AND post_time < 2016-04-19T22:04:30-08:00

For getting the recently updated list I need to query on the current_revision.last_edit_time. However as per the developer documentation we cannot include current_revision.last_edit_time in the where clause of the query.

https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv2&collection=messages#constraints

 

Can someone please let me know if there is any other way to get the recently updated messages and replies in a community?

 

Thanks!

    • cgmcconnell's avatar
      cgmcconnell
      Expert

      Hi Doug,

       

      conversation.last_post_time does get updated when I add a new reply to a message, but it does not get updated when a message body itself is modified. It also does not get updated when an existing reply to a message is updated. Please let me know if my understanding is incorrect.

       

      Thanks,

      Deepti

       

       

       

      • DougS's avatar
        DougS
        Khoros Oracle

        That sounds right. I don't think there is a field in v2 that tracks the last time a message was edited. There is the current_revision field, but that only has the revision number, not the last revision datetime.