Hi.
I need to fetch the latest topics in public categories from my forum via an API call and embed them in my parent website.
I have implemented a basic solution using /latest
endpoint.
I was successful in only fetching the latest topics from public categories via the following procedure -
- Fetch all the categories using the
/categories
endpoint. - Filter out the private categories via the
read_restricted
field. - Call the endpoint -
http://127.0.0.1:9292/latest?exclude_category_ids%5B%5D=<private_category_id_1>&exclude_category_ids%5B%5D=<private_category_id_1>&exclude_category_ids%5B%5D=<private_category_id_3> ......
As you can see, the length of the URL will go on increasing with the number of private categories.
Is there any better solution apart from this (and exposing a custom end-point via a plugin) ?
Note - I do not want to use “suppress from latest” feature. I want it under the latest tab in the forum but not in the API call response.