# 通过 REST-API 创建用户似乎无法工作

**URL:** <https://meta.discourse.org/t/create-user-via-rest-api-does-not-seem-to-be-working/355112>\
**Category:** Support\
**Created:** [2025年二月28日 22:16 UTC](https://meta.discourse.org/t/create-user-via-rest-api-does-not-seem-to-be-working/355112 "2025-02-28T22:16:29Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [2025年三月3日 16:03 UTC](https://meta.discourse.org/t/create-user-via-rest-api-does-not-seem-to-be-working/355112/8 "2025-03-03T16:03:52Z")

</div>

这会有所帮助，是的。

这仍然没有解决消息误导管理员的原始问题。

```plaintext
○ → curl -X POST -H \"api-key: $API_KEY\" -H 'api-username: michael' https://try.discourse.org/users.json --json \"$(jo email=michael+test@contoso.com username=michaeltest password=$PASSWORD active=true approved=true)\"
{\"success\":true,\"active\":true,\"message\":\"Your account is activated and ready to use.\"}

○ → curl -X POST -H \"api-key: $API_KEY\" -H 'api-username: michael' https://try.discourse.org/users.json --json \"$(jo email=michael+test2@contoso.com username=michaeltest2 password=$PASSWORD active=true approved=true)\"
{\"success\":true,\"active\":false,\"message\":\"Your account is activated and ready to use.\"}

```

^ 上面只创建了一个用户

我_推断_ `/users.json` 路径被大量混淆以阻止垃圾邮件发送者等，但这似乎也给管理员带来了麻烦。我想我们是否应该添加一个明确的管理员路径来区分两者（正常帐户创建与管理员帐户创建），这将允许管理员功能不被混淆。

---

_[View the full topic](https://meta.discourse.org/t/create-user-via-rest-api-does-not-seem-to-be-working/355112)._
