orli
(orjanL)
2021 年9 月 10 日 10:32
1
Hi, I would like to create some weekly statistic reports using the REST API. I will be doing this for
forum linkingyourthinking com
but I would like to start early before I have gotten the keys from the administrator which might take a while, since they are in the middle of a 6 week workshop.
So I was hoping to begin right now with try.discourse.org , Is that possible? I have tried
curl -X GET https://try.discourse.org/site.json
and it works nicely.
You can set up a local development instance of discourse for such work. It is fairly simple to do so.
See How do I set up a local Discourse Development Environment?
6 个赞
orli
(orjanL)
2021 年9 月 10 日 11:51
3
Thanks for the tip! Will there by any demo data in such an instance: users, groups and posts?
1 个赞
There will be some default seeded data but you’re always free to create some data as per your own need.
2 个赞
Falco
(Falco)
2021 年9 月 10 日 13:04
5
If you are doing reports on public data on try.discourse.org you won’t need the API keys, as the GET requests will work just fine without it!
3 个赞
orli
(orjanL)
2021 年9 月 10 日 13:11
6
Thank you! I don’t have the terminology clear for me right now. I want to
list all groups
for each group, list group member statistics: seen, posts, read time, …
do this on a weekly basis and mail to the group leaders/guides.
That data is probably not public?
1 个赞
Falco
(Falco)
2021 年9 月 10 日 13:20
7
It is! Discourse aims to be an open and crawleable platform by default . In fact you can even do the same on Meta.
orli:
list all groups
curl https://meta.discourse.org/g.json
orli:
for each group, list group member statistics: seen, posts, read time, …
curl https://meta.discourse.org/groups/translators/members.json?offset=0&order=&asc=true&filter=
https://meta.discourse.org/u/falco/summary.json
Group leader data will be on the first request.
7 个赞
大家好,有人能告诉我 Api 密钥和 Api 用户名之间的区别和用法吗?
Canapin
(Coin-coin le Canapin)
2025 年1 月 28 日 15:47
9
API 用户名将告知 Discourse 哪些功能已启用。管理员或普通用户不具备相同的功能,使用其中一个或另一个将限制您通过 API 可以实现的功能。
API 密钥是与 API 用户名一起使用的密码。
1 个赞
在我的场景中,我只想使用 discourse api,我的困惑是,每个使用我的应用程序的用户都可以创建帖子、点赞、评论和其他功能,那么我现在是否需要为每个用户创建 api-username 和 api-key 来使用各自的 api?
根据文档,我创建了一个“所有用户”API 密钥,但在使用 Postman 调用此 API /tags.json 时收到此错误:
{
"errors": [
"您无权查看所请求的资源。API 用户名或密钥无效。"
],
"error_type": "invalid_access"
}
您能帮我解决这个问题吗?