Is it possible to change ownership of these pseudo-posts? (Or whatever they are called!)
Thanks.
Is it possible to change ownership of these pseudo-posts? (Or whatever they are called!)
Thanks.
The small action posts? You can’t change the ownership of those as far as I know. The small action would have to be deleted and the topic opened and closed again (for example) with whoever you want to own the small action closing the topic.
This is a curiosity contribution…
Even though there’s not an admin wrench on the small action posts, they still get a post id - is it possible to change ownership of them through the API?
Thanks for the idea. I’ve never used the API before but would be happy to give it a go if someone would confirm that it would work here…
Would I just type this at the command line?
curl -X POST "http://forum.example.com/t/[TOPIC_ID]/change-owner.json" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: ................." \
-H "Api-Username: ..............." \
-F "post_ids[]=[POST_ID]" \
-F "username=[NEW_USERNAME]"
I can work out the [TOPIC_ID] from the URL, the API key/username from Settings-API, and [POST_ID] from looking at Chrome’s dev tools.
I’m afraid I’m punching above my weight on this one. I’ve also not used the API yet, but I hope someone else can chime in.
Just to circle back to this one via the scenic route… but I have finally gotten round to using Postman and have successfully managed to change ownership of a small action post using the API
Could you possibly expand on this? Thanks.
I’ll try
I grabbed the link of the topic where the small action post is, and popped /change-owner.json
on the end, and added it to the top bar as a POST request (and entered my API-Key API-Username, plus Content-Type into the Headers tab):
I then looked up the post_id of the small action post I wanted to change in the post.json (eg. /t/tag-test-topic-one/762/2.json
) and added the post_ids[]
and username
Keys and Values to the body tab, under ‘form-data’:
Then clicked the ‘Send’ button.
Cool. I’ve found Plans & Pricing | Postman API Platform and wonder – is it possible to do what you describe above without paying for their plans? I don’t think I could justify any expense for this small task
I didn’t pay for it, so I think there must be a free option. Maybe this page?
Though that’s only one way. I think you can also use curl to make requests from a terminal, though this I have not mastered yet.
There are many free software for making API requests like Postman. I use Insomnia. A matter of preferences and availability depending on your OS, mostly.
Here’s a simple example with curl from command line:
curl -X POST "https://your-discourse.com/posts.json" -H "Content-Type: application/json" -H "Api-Key: YOUR_API_KEY" -H "Api-Username: YOUR_USERNAME" -d "{\"title\": \"Test topic creation with the API\", \"raw\": \"And here's the topic's content\", \"category\": CATEGORY_ID }"