"Api-Key" and "Api-Username" for 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 Likes

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

1 Like

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

2 Likes

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 Likes

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 Like

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 Likes

Hi can anyone tell me the difference and usage of Api-key and Api-Username.

The api username will tell Discourse which capabilities are enabled. An admin or a regular user don’t have the same capabilities, and using one or another will restrict what you can achieve using the api.

the api key is the password to be used with the api username.

1 Like

So in my scenario I only want to use the discourse api and my confusion is that every user who is using my app can create post, like, comment other features so now do i want to create api-username and api-key for each user to use respective api’s?

have you read the api documentation?

especially this

also these

1 Like

Acc. to doc I have created a “All users” api key but I am getting this error

{
    "errors": [
        "You are not permitted to view the requested resource. The API username or key is invalid."
    ],
    "error_type": "invalid_access"
}

in post man while hitting this api /tags.json.
Can you please help me with this

Can you post your full request here?

1 Like