Forum Discussion

dhiraj_gophane's avatar
9 years ago

Get all ideas in community posted in last 30 days

Hi All,

 

We need to fetch ideas for last 30 days from whole comminity using REST API call. Could you please let us know.

 

Regards,

Dhiraj

  • dhiraj_gophane's avatar
    dhiraj_gophane
    9 years ago

    Hello Everyone,

     

    Following REST call worked for me which I got from support team. 

     

    SELECT * FROM messages WHERE conversation.style = 'idea' AND conversation.last_post_time > 2015-12-01T10:04:30-08:00
    AND conversation.last_post_time < 2015-12-31T10:04:30-08:00 AND depth=0 ORDER BY conversation.last_post_time DESC

     

    Also followiong article is helful,

    http://community.lithium.com/t5/Community-API-v2/Message-resource/ta-p/113091

     

    Regards,

    Dhiraj

  •  

    dhiraj_gophane I hope this will help you.

    <#assign apiVersion = "2.0"/>
    <#assign ideaQuery = "select * from messages where conversation.style='idea' and depth=0"/>
    <#assign ideas = rest(apiVersion, "/search?q=" + ideaQuery?url+ 
    "&max_age=one_month").data.items/>

    Give kudos if you find my post helpful.

     

    • PaoloT's avatar
      PaoloT
      Lithium Alumni (Retired)

      You will also need to paginate (in case the number goes above the maximum returned by a single REST call) - in LIQL this can be done using the OFFSET and LIMIT syntax. 

      • Hi TariqHussainPaoloT,

         

        Thank you for the inputs. 

         

        Could you please cofirm if we can do this call from external JAVA app. If yes, could you please let us know if there are any specific changes needed to the API call?

         

        Regards,

        Dhiraj