I’m pursuing some customizations (such as described here and here) that seem to require a solid understanding of Ember and Rails and also how the underlying Discourse codebase fits together.
As a result, it’s been slow going (I’m more used to Angular and Javascript, and new to Discourse), so I’m looking for ways to get these customizations out the door faster.
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?
Having a solid grasp of the API seems more efficient than a solid grasp of Ember and the Discourse codebase, and could be implemented using languages like pure javascript or jquery.
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?