Forum Discussion

amuthan's avatar
amuthan
Adept
8 years ago

How to retrieve recent posts with replies count and solution mark?

I need to retrieve the post which has answer and replies count

  • Hi,

    I am using V1 rest API.Can you we get the same using V1?
    • cike's avatar
      cike
      Champion

      Hi amuthan,

       

      if you want to use APIv1, you have to use multiple request to get all information. Take a look at the message resource of APIv1:

       

      There you get a request for replies:

      http://community.lithium.com/community-name/restapi/vc/messages/id/[id]/replies/count

      and an other one for the solution marker:

      http://community.lithium.com/community-name/restapi/vc/messages/id/[id]/solutions/solution

      Best regards,

      Christian

      • amuthan's avatar
        amuthan
        Adept

        Thanks for the reply.

         

        I need it as single endpoint that should give root message topic,replies count,solution there or not,timestamp,author id with image.

        Performance based approach is needed.

  • Hi amuthan,

    You can use V2 Query to fetch recent posts with replies count and accepted solution.

    V2 Query:
    Select replies.count(*),id,subject,post_time,conversation.solved from messages where depth = 0 ORDER BY post_time DESC

    Hope this helps.