Sha256: ab36062a83122732c20819de71d5728d99e5462ca0cc79660e5aa2c1326eff8b

Contents?: true

Size: 397 Bytes

Versions: 1

Compression:

Stored size: 397 Bytes

Contents

module DiscourseApi
  module API
    module ApiAdmin
      def api
        response = get("/admin/api.json")
        response.body
      end

      def generate_api_key(user_id)
        response = post("/admin/users/#{user_id}/generate_api_key.json")
      end

      def revoke_api_key(user_id)
        response = delete("/admin/users/#{user_id}/revoke_api_key.json")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discourse_api-0.4.0 lib/discourse_api/api/api_admin.rb