Sha256: 71ac21e98e982af32668bdcbe8890ec7df17a6d9cc17779babb29b41393f23a0
Contents?: true
Size: 1.14 KB
Versions: 4
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require File.expand_path('../../lib/discourse_api', __FILE__) # client = DiscourseApi::Client.new("http://localhost:3000") # client.api_key = "YOUR_API_KEY" # client.api_username = "YOUR_USERNAME" # client = DiscourseApi::Client.new("http://localhost:8080") client.api_key = "a56a349e1870529d8d8da11453ea782ce8ab8de34d6564a65727171163be4338" client.api_username = "system" ### # Required category params: # :name, :color, :text_color # Optional category params: # :slug, :permissions, :auto_close_hours, :auto_close_based_on_last_post, :position, :email_in, # :email_in_allow_strangers, :logo_url, :background_url, :allow_badges, :topic_template ### # Create category new_category = client.create_category( name: "Test Category", color: "AB9364", text_color: "FFFFFF" ) puts 'Created category: ' + new_category.to_s # Update category response = client.update_category( id: new_category['id'], name: "The Best Test Category", slug: "the-best-test-category", color: "0E76BD", text_color: "000000" ) puts 'Updated category: ' + response.to_s
Version data entries
4 entries across 4 versions & 1 rubygems