I want to be able to create an API key for the user to pass down to our application so that they can create posts from the application. I’ve figured out how to add users via the REST api (using the honeypot values) but can’t seem to use the generate_api_key method in the Admin::UsersController.
It’s telling me the route doesn’t exist, but I’ve verified that it definitely does by looking at the request made from chrome when clicking on “Generate API key” for that user - although that request uses the CSRF token.
Is it possible to POST to the same API via JSON with a master API key?
Started POST "/admin/users/8/generate_api_key.json?api_key=a246e85e1334501c7dcd0ef731162466eea0ad1d11733690c5a36a21c3c21377" for 127.0.0.1 at 2014-02-27 14:40:16 -0800 ApiKey Load (1.1ms) SELECT "api_keys".* FROM "api_keys" WHERE "api_keys"."key" = 'a246e85e1334501c7dcd0ef731162466eea0ad1d11733690c5a36a21c3c21377' ORDER BY "api_keys"."id" ASC LIMIT 1 ActionController::RoutingError (No route matches [POST] "/admin/users/8/generate_api_key.json"): config/initializers/quiet_logger.rb:10:in call_with_quiet_assets' config/initializers/silence_logger.rb:19:incall' lib/middleware/missing_avatars.rb:21:in call' lib/middleware/turbo_dev.rb:32:incall'