¿"Api-Key" y "Api-Username" para try.discourse.org?

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 Me gusta

Thanks for the tip! Will there by any demo data in such an instance: users, groups and posts?

1 me gusta

There will be some default seeded data but you’re always free to create some data as per your own need.

2 Me gusta

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 Me gusta

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 me gusta

It is! Discourse aims to be an open and crawleable platform by default. In fact you can even do the same on Meta.

curl https://meta.discourse.org/g.json

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.

:slightly_smiling_face:

7 Me gusta

Hola, ¿alguien puede decirme la diferencia y el uso de Api-key y Api-Username?

El nombre de usuario de la API le indicará a Discourse qué capacidades están habilitadas. Un administrador o un usuario normal no tienen las mismas capacidades, y usar uno u otro restringirá lo que puede lograr usando la API.

La clave API es la contraseña que se usará con el nombre de usuario de la API.

1 me gusta

Entonces, en mi escenario, solo quiero usar la API de Discourse y mi confusión es que cada usuario que usa mi aplicación puede crear publicaciones, dar “me gusta”, comentar y usar otras funciones, ¿así que ahora quiero crear un nombre de usuario de API y una clave de API para cada usuario para que usen sus respectivas API?

¿Has leído la documentación de la API?

Especialmente esta

También estas

1 me gusta

Según el documento, he creado una clave API de “Todos los usuarios”, pero estoy recibiendo este error

{
    "errors": [
        "No tiene permiso para ver el recurso solicitado. El nombre de usuario o la clave de la API no son válidos."
    ],
    "error_type": "invalid_access"
}

en Postman al llamar a esta API /tags.json.
¿Puede ayudarme con esto?

¿Puedes publicar tu solicitud completa aquí?

1 me gusta