# 使用 REST API 获取最近更新的帖子

**URL:** https://meta.discourse.org/t/getting-recently-updated-posts-using-the-rest-api/220071
**Category:** General
**Tags:** rest-api
**Created:** [2022年三月4日 15:18 UTC](https://meta.discourse.org/t/getting-recently-updated-posts-using-the-rest-api/220071 "2022-03-04T15:18:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jurgc11](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jurgc11/32/251988_2.png) [@jurgc11](https://meta.discourse.org/u/jurgc11)
#### Post date: [2022年三月4日 15:18 UTC](https://meta.discourse.org/t/getting-recently-updated-posts-using-the-rest-api/220071/1 "2022-03-04T15:18:28Z")

</div>

是否可以通过 REST API 获取最近更新（包括创建）的帖子？我知道有这个端点：[Discourse API Docs](https://docs.discourse.org/#operation/listPosts%EF%BC%8C%E4%BD%86%E6%88%91%E8%AE%A4%E4%B8%BA%E5%AE%83%E6%98%AF%E6%8C%89%E5%88%9B%E5%BB%BA%E6%97%B6%E9%97%B4%E6%88%B3%E6%8E%92%E5%BA%8F%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E6%8C%89%E6%9B%B4%E6%96%B0%E6%97%B6%E9%97%B4%E6%88%B3%E6%8E%92%E5%BA%8F%E3%80%82)

我试图获取 Discourse 中的所有更改并将其发送到另一个系统。或者有其他方法可以做到吗？目前我正在考虑直接查询数据库，但我宁愿避免依赖内部数据库架构。提前感谢。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2022年三月4日 15:30 UTC](https://meta.discourse.org/t/getting-recently-updated-posts-using-the-rest-api/220071/2 "2022-03-04T15:30:53Z")

</div>

> [@jurgc11](#):
>
> 我试图获取在 Discourse 中所做的每一次更改，并将其发送到另一个系统。

听起来这是一个使用 webhook 的工作。您可以添加一个 webhook，让它在每次帖子更改时通知您的系统。

> [@jurgc11](#):
>
> 有没有办法使用 REST API 获取最近更新（包括创建）的帖子？

请参阅[如何使用 Discourse API 运行 Data Explorer 查询](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063)

---

<div class="post-metadata">

### Author: ![jurgc11](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jurgc11/32/251988_2.png) [@jurgc11](https://meta.discourse.org/u/jurgc11)
#### Post date: [2022年三月4日 15:55 UTC](https://meta.discourse.org/t/getting-recently-updated-posts-using-the-rest-api/220071/3 "2022-03-04T15:55:23Z")

</div>

谢谢，这两个看起来都是不错的选择。
