orli
(orjanL)
Setembro 10, 2021, 10:32am
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 curtidas
orli
(orjanL)
Setembro 10, 2021, 11:51am
3
Thanks for the tip! Will there by any demo data in such an instance: users, groups and posts?
1 curtida
There will be some default seeded data but you’re always free to create some data as per your own need.
2 curtidas
Falco
(Falco)
Setembro 10, 2021, 1:04pm
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 curtidas
orli
(orjanL)
Setembro 10, 2021, 1:11pm
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 curtida
Falco
(Falco)
Setembro 10, 2021, 1:20pm
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 curtidas
Olá, alguém pode me dizer a diferença e o uso de Chave de API e Nome de usuário de API.
Canapin
(Coin-coin le Canapin)
Janeiro 28, 2025, 3:47pm
9
O nome de usuário da API informará ao Discourse quais recursos estão habilitados. Um administrador ou um usuário regular não têm os mesmos recursos, e usar um ou outro restringirá o que você pode alcançar usando a API.
A chave da API é a senha a ser usada com o nome de usuário da API.
1 curtida
Então, no meu cenário, eu só quero usar a API do Discourse e minha confusão é que todo usuário que está usando meu aplicativo pode criar posts, curtir, comentar e outros recursos, então agora eu quero criar um nome de usuário de API e uma chave de API para cada usuário usar as APIs respectivas?
Lilly
(Lillian Louis)
Janeiro 29, 2025, 6:40am
12
Você leu a documentação da API?
Especialmente isto
Discourse contains a system for generating API keys per user if a very specific protocol is followed. This feature facilitates “application” access to Discourse instances without needing to involve moderators.
High level description
At a high level:
Client (desktop app, browser plugin, mobile app) generates a private/public key pair and return url
Client redirects to a route on discourse giving discourse its public key
Discourse gets approval from user to use app
Discourse generat…
Também estes
Discourse API
Please view the Discourse API Documentation site for detailed info:
https://docs.discourse.org
Deprecation Warning!
On April 6th, 2020 we dropped support for all non-HTTP header based authentication (excluding some rss, mail-receiver, and ics routes). This means that API requests that have an api_key and api_username in the query params or in the HTTP body of the request will soon stop working. Please see the example cURL request below for how to update your API requ…
1 curtida
De acordo com o documento, criei uma chave de API “Todos os usuários”, mas estou recebendo este erro
{
"errors": [
"Você não tem permissão para visualizar o recurso solicitado. O nome de usuário ou a chave da API é inválido."
],
"error_type": "invalid_access"
}
no Postman ao acessar esta API /tags.json.
VocĂŞ pode me ajudar com isso?
Canapin
(Coin-coin le Canapin)
Fevereiro 4, 2025, 12:36pm
14
Você pode postar sua solicitação completa aqui?
1 curtida