Forum Discussion

dkytasaari's avatar
5 years ago

Is there a LiQL to retrieve all posts and content under a category

I have a category called "Getting Started / How It Works" and I would like to retrieve all of the messages and their content from the two boards that are underneath it.

Based on some other posts that I saw, I tried this...

select subject,body from messages where category.id = 'Getting Started / How It Works'

But it only yielded me a JSON response of:

{
"status" : "success",
"message" : "",
"http_code" : 200,
"data" : {
"type" : "messages",
"list_item_type" : "message",
"size" : 0,
"items" : [ ]
},
"metadata" : { }
}

Does category.id need to be a number?  If so, where would I find it.  I can't find a number in View Source if there is one. 

  • Tarun's avatar
    Tarun
    5 years ago

    Hi dkytasaari ,

    Yes, you can get more than 25, you just need to pass the parameter limit with it.

    Eg: select subject, body from messages where category.id = 'howitworks' limit 50.

    Please Give Kudos if you find this post useful and mark this as Accepted Solution if this is the required solution.


    Regards

    Tarun Kumar

     

  • It looks like I figured it out.  I found an ID under the CoreNode in View Source that is "howitworks".  I plugged that in as the category.id and that gets results, 25 at a time.  I wonder if there is a way to get more than 25, or if that is a built in restriction for LiQL to reduce load.

    • Tarun's avatar
      Tarun
      Maven

      Hi dkytasaari ,

      Yes, you can get more than 25, you just need to pass the parameter limit with it.

      Eg: select subject, body from messages where category.id = 'howitworks' limit 50.

      Please Give Kudos if you find this post useful and mark this as Accepted Solution if this is the required solution.


      Regards

      Tarun Kumar