用于检索社区电子邮件地址的 API 端点

我希望有人能指点我,在哪里可以设置我的端点,以便通过 API 调用检索与我组织特定社区关联的用户电子邮件地址。

我可以访问活跃用户、新用户和其他用户的端点;但是,除了我的账户外,其他用户的关联电子邮件均未返回。

谢谢。

Maybe this:
https://meta.discourse.org/t/api-best-way-to-get-user-details-by-email/20806/10?u=dax

This only looks to return my email - and no one else’s. In fact, the "email": endpoint is only visible for my user

I’m seeing the same problem with the users/list API call. The email addresses are not being returned, and I’m using an API key generated for the system user, which should be all-powerful?

The API documentation definitely says that “email” should be non-empty.

I’m using v1.9.2.

I’ve found the answer here:

https://meta.discourse.org/t/email-address-no-longer-being-exposed-on-discourse-api/21109

The API has changed.

有人知道目前通过 API 查询电子邮件地址的状态吗?(链接的页面已不存在。)

API 文档指出,email 字段 应被返回/admin/users/{id}.json,但当我向该地址发送请求时,该字段缺失。

我有一份 Discourse 用户名列表,正试图获取他们的电子邮件地址,以便与另一个系统中的电子邮件地址进行匹配。

# 我从这里获取用户 ID:
f"{BASE_URL}/u/{username}.json"

# 然后尝试从这里获取电子邮件地址:
f"{BASE_URL}/admin/users/{user_id}.json"

如果电子邮件地址不再在此处提供,是否还有其他方式可以从用户名编程获取它?

我通过查看浏览器中的网络请求找到了另一种方法。这个 URL 可以正常工作:

f"{BASE_URL}/u/{username}/emails.json"