Forum Discussion

leheinlein's avatar
leheinlein
Contributor
11 years ago

REST APIs not returning all containers

I'm having issues with not getting correct responses back from the REST API myurl.com/restapi/vc/blogs returns

 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response status="success">
  <blogs/>
</response>

 

despite the fact that there is a system blog.  

 

Similarly, a call to myurl.com/restapi/vc/categories/id/Prepaid/boards returns two boards - but that category has three boards, not two.  And it's not an issue of not being able to access the missing board, since if I query for it directly using its ID, I get its details returned successfully

 

Is this a known issue?

  • DougS's avatar
    DougS
    11 years ago

    Do you have "hide from lists and menus" checked on the board that does not show up?  (click on "edit properties" to check this) That will cause it not to display in the list of boards.

  • DougS's avatar
    DougS
    Khoros Oracle

    For the boards call, is one of the boards in a sub-category beneath the category you have in your REST call?  if so, you should do /boards/nested -- the nested call gets you not only the boards in the category you are are making the call for, but also for any sub-categories.  If you are making the call without a category specified, the nested call gets you all boards in the community rather than just the boards that are created directly under the community node.

     

    If you want all the boards for the category and any sub-categories: myurl.com/restapi/vc/categories/id/Prepaid/boards/nested

     

    For the /blogs call, it should work, but again you might have your blogs under categories/sub-categories.  The /blogs call is actually deprecated, so we don't have support for /blogs/nested.  You want to make the /boards/style/blog/nested call instead -- here is the documenation for that call: 

     

    http://lithosphere.lithium.com/t5/rest-api/bd-p/developers-rest-api?leaf-id=Community.boards#Community.boards.style.style.nested

     

    • leheinlein's avatar
      leheinlein
      Contributor

      Thank you for the response!  The boards are all on the same level.  Just to be sure, I added the /nested parameter, but I am still only returned 2 boards.

       

      Here's what it looks like in the community structure:

       

      boards.png

       

      Both API calls (with and without the "nested" parameter) return the first and third boards, but not the middle one.

      • DougS's avatar
        DougS
        Khoros Oracle

        Check the permissions set on each of the boards vs. the permissions allowed to the user you are making the REST API call as (or if you are making the call without the restapi.session_key parameter you are making the call as an anonymous user and have the default permissions set on the board) -- it's possible that one of boards has permissions set that don't allow the caller to see the board and that is why it's not being returned in the results.