Hey.
I was wondering if there’s any way to allow all users to see users post_count when using the API call /users/{username}.json without having to modify the git repo?
Is there something like a setting or plugin for this?
The discussion revolves around accessing a user’s post count through the Discourse API. Wille initially asked if there’s a way to allow all users to see the post count without modifying the git repo. codinghorror suggested retrieving it from https://meta.discourse.org/u/username.json, but this method only works for the user’s own profile.
Wille clarified that they want the post count to be publicly visible to everyone, including anonymous browsers. After exploring the API and settings, Wille found no solution, including attempting to add custom fields.
RJG provided a solution, suggesting that the post count can be found in https://meta.discourse.org/u/username/summary.json. Wille appreciated the help and asked for guidance on navigating the API, as they couldn’t find any documentation on summary.json.
RJG recommended a topic on reverse-engineering the Discourse API, which might be helpful in the future: https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576.
Hey.
I was wondering if there’s any way to allow all users to see users post_count when using the API call /users/{username}.json without having to modify the git repo?
Is there something like a setting or plugin for this?
You can retreive it from https://meta.discourse.org/u/Wille.json under
"post_count":0
Your topic count is 1.
Sure, that works when looking up the profile of ones own user, but I would like the post_count to be public to everyone, preferably even to anonymous browsers.
If I look up https://meta.discourse.org/u/Codinghorror.json there’s no post_count there, just the same as with https://meta.discourse.org/users/Codinghorror.json
Bump, not just for seeing post_count but being able to configure the API. Possible?
Edit: Never mind, may have found it under Settings → User → public user custom fields
Edit2: Never mind the never mind, adding ‘post_count’ there didn’t help. Is there some kind of syntax here like user@user_fields@post_count ?
Edit3: Doesn’t seem to work with custom created fields either. I added “Discord ID” both in Customize → User Fields and Settings → User → public user custom fields, doesn’t show up even in my (admin’s) own json /users/admin.json when logged in as admin.
Appreciate it a lot!
Is there any rhyme or reason to the API so I know where to look next time for something in the future?
I can’t find any mentions of summary.json in the API docs for instance.
This topic might help: Reverse engineer the Discourse API