Hello @team
I’ve been trying to rename topics via the API.
I’ve looked at the API docs and the code in GitHub, and I can’t seem to make the request.
Things I’ve tried:
‘http://{discourse-url}/t/{topic-slug}/{topic-id}’ with the new title, api_key, and api_username in JSON
’http://{discourse-url}/t/{topic-slug}/{topic-id}’ with the new title, api_key, and api_username as form data
’http://{discourse-url}/t/{topic-slug}/{topic-id}’ with the new title as JSON, and api_key, and api_username as form data
’http://{discourse-url}/t/{topic-slug}/{topic-id}’ with the new title as JSON (or form data), and api_key, and api_username as headers
I’ve also tried just using ‘http://{discourse-url}/t/{topic-id}.json’ with the various arrangements of the data. I have also tried looking at the chrome developer tools and trying to mimic that call (even copying and pasting the token instead of using the api key and username).
No matter what I try, I either get a “BAD CSRF” error, or am told that I don’t have the correct access rights to view the page.
I have not had trouble with other API requests using the same key and username (making topics, making categories, renaming/changing categories).
I would really appreciate some help here as I’ve been stuck with this for a few days now.
Thanks!