Forum Discussion

lnuanez's avatar
lnuanez
Guide
13 years ago

Getting the number of messages under all boards of a given category

Hi all,

 

Trying to figure out how to do this with one API call so I don't need to loop through a result with multiple API calls.

 

Given a particular category ID, I want to get a list of all boards under that category, and the number of posts in each of those boards.

 

I see how to do this with one call to get the list of boards:

/categories/id/XXX/boasrds

 

Then I can loop through that, calling:

/boards/id/YYY/messages/count

 

But that seems far from optimal.  Can this be done with 1 call?

 

Thanks!

1 Reply

  • AdamN's avatar
    AdamN
    Khoros Oracle
    13 years ago

    Hi lnuanez,

     

    Unfortunately, there's no single REST API call to accomplish exactly what you're asking for. However, you could use our Studio Endpoints tool to create your own custom endpoint that would produce the response desired. The same number of REST API calls would still be made; however, those calls would be made on the Lithium application side instead of on your side. Thus, the endpoint serves to encapsulate all of the calls into a single method.

     

    If you don't already have Studio Endpoints enabled on your community, I'd suggest filing a case with our Support team so that they can assist in having it enabled for you.

     

    Regards,

     

    Adam