REST API vs. the Ruby API

Since I posted about reopening the module, I figured I should try it out with your method to make sure it’s possible. Adding this code to a file and running it from the command line is working for me.

require 'discourse_api'

module DiscourseApi
  module API
    module Notifications
    	def set_group_user_notification_level group, user_id, notification_level
    		post("/groups/#{group}/notifications?user_id=#{user_id}&notification_level=#{notification_level}")
    	end
    end
  end
end

client = DiscourseApi::Client.new("http://localhost:3000")
client.api_key = "<your-api-key>"
client.api_username = "system"

response = client.set_group_user_notification_level 'running', 1, 3

puts "Response: #{response}"