Have you attempted to generate a key from your account? You are the admin who created the forum, yes? You say “users/system” so I am wondering if you tried your own account.
I have tried both my username and system with no luck. I can’t call client.category_latest_topics(<category_name>) even though the user has permissions to the category
Is anyone else experiencing this problem at the moment? I’ve been trying for two days to use the API, but I get similar errors every time. I’m not sure if I’m missing a step or if something changed.
I created a new API key for the system user. I also tried creating an API key for all users and then using my admin account.
Using the discourse_api Ruby gem:
DiscourseApi::UnauthenticatedError ({"errors"=>["You are not permitted to view the requested resource. The API username or key is invalid."], "error_type"=>"invalid_access"})
For the error that you’re getting with the raw ruby code, the problem is that the Api-Key and Api-Username need to be set in the request headers. The API field names also need to use dashes (-) instead of underscores (_). Have a look at the Authentication section at the top of https://docs.discourse.org/ for details about how to authenticate the request.
I’m not sure what would be causing the error when you make the call with the Discourse API gem. The most likely cause of the problem is that you aren’t using the correct API credentials. Make sure that you are using an API key that has its User Level set to All Users: