Do we have any API or way to get latest post details for a particular Topic in discourse?


(Aaditya Agrawal) #1

Hi,
As mentioned, do we have any API or way to get latest post details for a particular Topic in discourse ?
Also is there any way to get All/Latest/Top posts for a particular Topic in discourse ?

Thanks in adv.


#2

(Aaditya Agrawal) #3

I have already checked into docs. Please let me know url if I missed it .


#4

http://docs.discourse.org/#tag/Topics%2Fpaths%2F~1t~1{id}.json%2Fget


(Aaditya Agrawal) #5

Thanks. This will get me list of all posts for a particular topic.
My goal : Get a latest post for each topic from a certain category.
Pros: I can get required solution to satisfy my solution.
Cons: Due to multiple API calls for each topic, user experience will get deteriorated by a measurable factor.

Do you have any suggestion or approach to satisfy my above goal ?


(Blake Erickson) #6

You probably want to setup a webhook if your goal is to find out when someone posts to a topic. A webhook can trigger on a new topic creation, new post, or when a new user was created. A webhook will send you a POST request to a specified endpoint that you setup so it will be significantly less api calls.