Forum Discussion

leheinlein's avatar
leheinlein
Contributor
12 years ago
Solved

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
    12 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.

9 Replies

  • DougS's avatar
    DougS
    Khoros Oracle
    12 years ago

    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
    12 years ago

    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
    12 years ago

    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.

  • leheinlein's avatar
    leheinlein
    Contributor
    12 years ago
    The permissions for these boards are all the same (default all the way down). Additionally, if I make a REST call to that particular board (myurl.com/restapi/vc/boards/id/Rewards), I do get the board information, so the issue isn't one of not having permission to view that board's information
  • DougS's avatar
    DougS
    Khoros Oracle
    12 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.

  • nils-drews's avatar
    nils-drews
    Helper
    11 years ago

    My problem is that I want to access these boards from the REST API but NOT expose them on the main UI .... is there any possibility for that?

  • nils-drews's avatar
    nils-drews
    Helper
    11 years ago

    OlivierS you were helpful on this before perhaps you can have a look here? Is it possible to get hidden categories via the API somehow? A hidden parameter to the HTTP call? Some additional permission your user account needs who does the request? Some config option on the Admin Screens?

  • irach15's avatar
    irach15
    Maven
    9 years ago

    nils-drews,

    did you find how to do it?

    ...............................................

    We are having a bit different issue.

    We have users that can see some subcategories under common main category. 

    They don't see each others subcategories when the go to main/parent category page.

    However,

    site main navigation using REST API v1 to create a dynamic Mega Navigation.

    And in the navigation, those users can see each other subcategories, which they are not supposed to.

    When they click on subs not supposed to be seen, they see empty page.

    We have no idea how to fix it, checked everywhere.  The code looks fine, Admin setting too...

    Anyone?