Forum Discussion

rizalvi's avatar
rizalvi
Mentor
12 years ago

Get All Posts in Community through Rest

Is there a way to get a list of every post in your community? Is this possible through the rest api, metrics, or some other method?

 

I ask because, I need a way to traverse the results for spefic piecies of information.

4 Replies

  • NoamanA's avatar
    NoamanA
    Lithium Alumni (Retired)
    12 years ago

    Hi rizalvi

     

    Yes, you could use the following REST call to return all the posts in your community in xml format.  You could then just run a search through the results for the specific pieces of information you're interested in:

     

    http://community.lithium.com/community-name/restapi/vc/posts

     

    Bear in mind that your results might be affected by permission settings at different levels of the community but as an admin this generally shouldn't be an issue.  If this doesn't give you results you're after please provide details and we can investigate further.

     

    Regards

    Noaman

     

     

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    12 years ago

    In addition to what NoamanA said - there are also other considerations to make when adopting such an approach. For example, if you have a very large community, it may be inefficient to traverse the entire posts tree, especially if it's a frequent task - probably we would be able to help out better with some more detail around the specific problem you are trying to solve.

     

    Thanks,

  • rizalvi's avatar
    rizalvi
    Mentor
    12 years ago

    I posted this thread on video aggregation.

    I'll summarize the question from that thread and why I wanted to traverse all posts.

     

    I want to find every video posted on the community and link them on one page.

     

    An answer that seemed initially promising was that I should preform a search and return a filtered view of videos. However! How do you preform a blanket search on the entire community? I can do this on specific queries no problem. 

    One thing I did notice on my community is that all videos are stored /t5/video/gallerypage/video-id/ Then followed by some ID (NzZ2Z1ZD....) Can't find any documentation....

     

     

    This thread is helping me narrow down my path on how I should accomplish this task. If this doesn't work, I will likely tag each video post, and do a rest api call on returning posts with that tag. Then diving deeper to grab the links within the posts.

     

  • cblown's avatar
    cblown
    Boss
    12 years ago

    This won't help historically, however going forward you could use an event subscription and subscribe to MessageCreate and then have an external system process the message body looking for specific content and store the message ID for matches. Then have the remote system autheticate at some schedualled time adding labels to these posts for later filtering.

     

    http://lithosphere.lithium.com/t5/developers-knowledge-base/Subscribing-to-community-events-using-the-REST-API/ta-p/14785