Discourse api key

(da.fans.lu) #1

So i’m trying to use discourse api and in the examples here: discourse_api/example.rb at master · discourse/discourse_api · GitHub shows:

$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"

So can anybody walk me through what is going on here. Where do i retreive the api_key and api_username?

I have a discourse instance running on my localhost:3000 and another rails instance running on localhost:3001 that implements the api

(Arpit Jalan) #2

Hi! I wrote a howto for this: