Sha256: eff548e11efae993e8c92dcf62c5e359d88b6d40ce7ee81755336b97918a889c

Contents?: true

Size: 477 Bytes

Versions: 5

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true
module DiscourseApi
  module API
    module ApiKey
      def api
        response = get("/admin/api.json")
        response.body
      end

      def generate_master_key
        response = post("/admin/api/key")
      end

      def revoke_api_key(id)
        response = delete("/admin/api/key", id: id)
      end

      def regenerate_api_key(id)
        response = put("/admin/api/key", id: id)
        response.body
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
discourse_api-0.44.0 lib/discourse_api/api/api_key.rb
discourse_api-0.43.1 lib/discourse_api/api/api_key.rb
discourse_api-0.43.0 lib/discourse_api/api/api_key.rb
discourse_api-0.42.0 lib/discourse_api/api/api_key.rb
discourse_api-0.41.0 lib/discourse_api/api/api_key.rb