How to create post with ruby api?

Hello,

Can somebody tell me how to create post with ruby api?

It seems that there is only create topic api in discourse_api gem (GitHub - discourse/discourse_api: Ruby API for Discourse).

Check out the source code:
https://github.com/discourse/discourse_api/blob/master/lib/discourse_api/api/posts.rb

I’d assume create_post is what you’re looking for, but I’m not a Ruby expert.

3 Likes

Thanks, it just works!

Better if I can get the latest inserted topic_id when I call create_topic method. I’ll have a try!

1 Like