大家好,我最近有个想法,就是通过 API 创建一些假用户来在文章中提及用户名。这些假用户将初始化介绍信息,链接到我想向读者介绍的作者。
我目前正在参考 discourse 文档 Discourse API Docs Postman 应用中进行了测试。
我的步骤如下:
- 用户级别为“单个用户”,范围为“全局”。
- 设置身份验证类型为“API 密钥”。
- 密钥:… API 密钥
- 值:无
- 请求体为原始/JSON 格式。
{
"name": "name",
"email": "email",
"password": "pass",
"username": "username",
"active": true,
"approved": true,
"user_fields[1]": true,
"external_ids": {}
}
我收到的结果是响应 200,但当我检查我的电子邮件时,我没有收到任何邮件,系统也没有确认用户已创建。
{
"success": true,
"active": false,
"message": "<p>You’re almost done! We sent an activation mail to <b>email</b>. Please follow the instructions in the mail to activate your account.</p><p>If it doesn’t arrive, check your spam folder.</p>"
}
希望有这方面经验的人能帮助我。