I spent some time trying to debug this issue this evening, and I made some progress:
- I still get 403 Forbidden errors when I attempt to POST a JSON payload as string content with api_key and api_username in the header. I’m sure I’m simply not doing something correct here on my application’s side. I’m new to this whole web thing.

- However, I did discover why I was getting 403 Forbidden when sticking the payload directly in the URL (as above): the category I was attempting to post a new topic to had its permissions set to admins group only, and the user I was attempting to post as was not an admin. When I set that category up, I made it admin only so that I could do API testing in an isolated place; it didn’t occur to me that this would prevent me from posting as non-admins in that category using the API. Once I gave the user I was attempting to post as permission to create in that category, it worked right away. I think the whole CSRF token message in the logs was a red herring. The answer just came to me out of the blue; my debugging efforts didn’t really net me much.
So yeah: you get 403 Forbidden when attempting to post in a category as a user that doesn’t have permission to post in that category. Shocking! I guess part of me was thinking that by using the API key, I was basically overriding things like this. Apparently not. So this turns out to be almost entirely user error and I apologize for wasting people’s time. It would be nice if the logs were more clear about why a POST failed (or maybe they would be if I knew how to adjust Rails’ log level, but I don’t). Thanks for being patient with me!