Project

General

Profile

Can I add to the REST API via a plugin

Added by Mark Aufflick over 12 years ago

Hi all,

I'm wondering if there's an official way to extend the REST API in a plugin? Of course I could just make a controller endpoint that returned xml, but I will also need to bypass the usual cookie/login process and validate a token instead.

Can anyone point me to any docs or project that does this?

Cheers.


Replies (2)

RE: Can I add to the REST API via a plugin - Added by William Roush over 12 years ago

Screenshot Attach Plugin uses an API key:

https://bitbucket.org/StrangeWill/redmine-inline-attach-screenshot/src/f8698fd9487b/app/controllers/attach_screenshot_controller.rb

 skip_before_filter :check_if_login_required
 skip_before_filter :verify_authenticity_token

 # Redmine 1.3 and prior use accept_key_auth to enforce auth 
 # via the key we hand to the applet.
 if Redmine::VERSION::MAJOR == 1 and Redmine::VERSION::MINOR <= 3 then
 accept_key_auth :index
 else
 accept_api_auth :index
 end

RE: Can I add to the REST API via a plugin - Added by Nikolay Ruban about 9 years ago

Thanks @Roush, for suggestion. It saved my day.
#redmine #plugin #auth #redirect #api #apikey

How to add api key authentification to your redmine plugin.

    (1-2/2)