API to retrieve array of Topic IDs?

NodeBB Development
  • We are integrating parts of NodeBB into an internal application and will be managing a metadata recordset that ties topics in NodeBB to a type of record in our application. Our record could have multiple topics associated with it. We are successfully pulling back a single topic by id via the API using:

    /api/topic/<id>

    I would like to retrieve an array of topic ids from the NodeBB API in a single call, but am not seeing how to do that. Is there an API to get multiple topics?

  • Do you want to get an array of topic IDs, or any of topics by their IDs?

  • I already have the array of topic IDs. I want to retrieve all of those topics by their IDs.

    My current solution is to just loop through the array and do a fetch on the api for each ID individually, and then use a Promise.all to return the finished batch to my client middleware. Making separate http requests for each one is less desirable though, and I would prefer to get them all in a single fetch if possible.


Suggested Topics