A user, alexcomp, seeks help creating a topic via the Discourse API, encountering a 401 error. pfaffman advises against including the API key in the URL and suggests using headers instead. alexcomp shares their corrected script, still facing the 401 error. michaelhenderson recommends debugging with tools like curl or Postman, providing a link to a Postman workspace for Discourse API testing.
Thanks for the code. It’s hard to debug it fully without seeing all of the code. I would recommend querying the API outside of the script itself. For example, you could use curl
If you’re not comfortable with the command line or using curl, I would recommend using Postman to debug the issue with the API. Postman is essential for me as a developer when testing or building APIs.