Project

General

Profile

REST API routes definition and extension

Added by Brian Kirkpatrick almost 9 years ago

Hello,

I am looking into ways to add custom REST API entry points. So far I have identified:
  • Basic Rails routing (i.e., config/routes.rb)
  • Where specific views are rendered for API queries (i.e., app/views/issues/show.api.rsb)
  • Where transcriptions for specific data types are handled (i.e., lib/redmine/views/, including builders/ and co-located files)

However, I am at a loss in identifying the specific places where API entry points are defined. For example, consider a request for the http://[domain]/projects.json?key=0123456789 URL. The "config/routes.rb" file does not seem to have any matching patterns. Where is this entry point declared and routed? Is there some clever redirect taking place under "resources :projects do" in the routes.rb file that I haven't been able to reverse-engineer yet?

Once I have this information, I should be able to duplicate these entries and invoke an appropriate custom hook, which I plan on fulfilling in a plugin. I will, of course, be happy to post the work once I have a working solution.

Many thanks!