I use Discourse API client for PHP (by @michaeld I guess) and I can’t find how to get a category name/slug with only with an ID.
I need it to display (slug and id) of all our categories and their sub-categories.
But when I get the categories list, the only information about sub-categories is their id.
site.json sembra essere il metodo per ottenere un elenco di tutte le categorie. È menzionato da qualche parte su docs.discourse.org? Stavo cercando nei documenti un modo per ottenere i nomi delle sottocategorie, ma non l’ho trovato. Oppure esiste un metodo migliore?
Effettuare una richiesta API a site.json è il modo corretto per ottenere un elenco di categorie che includa le sottocategorie. Inoltre, se si desidera che le categorie private vengano restituite dalla richiesta a site.json, è necessario effettuare una richiesta API autenticata.
Non vedo alcun riferimento a site.json nella documentazione. Poiché categories.json non restituisce le sottocategorie, la descrizione della rotta categories nella documentazione non è corretta: afferma che la rotta restituisce tutte le categorie. Correggerò questo errore.