So, here’s the question: instead of creating a plugin that manipulates Discourse templates, could I accomplish the same end result using the JSON API?
I think the answer is yes. As the team has said, anything that discourse does can be done with the API.
I assume this can work, but the reason for the question: the normal use case for the JSON API, I assume, is a separate app that wants to interact with the Discourse app. In my case, it would be the Discourse app calling its own api.
For example, I had asked before about retrieving and showing the group owners of each group on the group index page. Normally, you would build a plugin for that.
In my case, I would do something like–in my customize dashboard under “<head”–call an AJAX function when the group index page loads that sends an API call to return the group owners of each group, and then inserts that info in each group listing.
Would that work? Would I need to generate an API key for that given that it’s coming from that app itself?