# 创建面向外部的 API 以创建主题的最佳方法？

**URL:** https://meta.discourse.org/t/best-way-to-create-external-facing-api-for-creating-topics/246567
**Category:** Development
**Tags:** rest-api
**Created:** [2022年十一月23日 17:25 UTC](https://meta.discourse.org/t/best-way-to-create-external-facing-api-for-creating-topics/246567 "2022-11-23T17:25:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Tim\_Lee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tim_lee/32/278524_2.png) [@Tim\_Lee](https://meta.discourse.org/u/Tim_Lee)
#### Post date: [2022年十一月23日 17:25 UTC](https://meta.discourse.org/t/best-way-to-create-external-facing-api-for-creating-topics/246567/1 "2022-11-23T17:25:57Z")

</div>

您好，

我目前的目标是在 Discourse 服务器上创建一个 HTTP POST 端点，该端点可以根据请求正文创建主题。该端点应接收来自任意 IP 的请求，且没有 CORS 问题。发送请求的客户端将是一个 Chrome 浏览器插件。构建 Discourse 插件是实现此目标的最佳方法吗？

我对 Discourse 还不熟悉，有点迷茫。非常感谢您的任何帮助！

---

<div class="post-metadata">

### Author: ![maiki](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maiki/32/233950_2.png) [@maiki](https://meta.discourse.org/u/maiki)
#### Post date: [2022年十一月23日 22:19 UTC](https://meta.discourse.org/t/best-way-to-create-external-facing-api-for-creating-topics/246567/2 "2022-11-23T22:19:46Z")

</div>

> [@Tim\_Lee](#):
>
> 我现在的目标是在 discourse 服务器上创建一个 HTTP POST 端点，该端点根据请求正文创建主题。

我认为我们已经有了您要找的东西：[https://docs.discourse.org/#tag/Topics](https://docs.discourse.org/#tag/Topics)

> [@Tim\_Lee](#):
>
> 构建 Discourse 插件是实现这一目标的最佳方式吗？

请查看 [https://meta.discourse.org/t/discourse-rest-api-documentation/22706，也许您想要的东西已经存在。^\_^](https://meta.discourse.org/t/discourse-rest-api-documentation/22706%EF%BC%8C%E4%B9%9F%E8%AE%B8%E6%82%A8%E6%83%B3%E8%A6%81%E7%9A%84%E4%B8%9C%E8%A5%BF%E5%B7%B2%E7%BB%8F%E5%AD%98%E5%9C%A8%E3%80%82%5E_%5E)
