Joe_F
(Joe Farrar)
28 Agosto 2025, 9:25am
1
Hi all,
I have set up a pipeline that pulls in all user information but the option to pull in their email is not available.
I have an admin role and the API key, etc, can I set this up, if so how? I want to add this column in a table for all users not a one off user query.
Kind regards, Joe
1 Mi Piace
Interestingly, something like /admin/users/{id}.json
doesn’t return the user’s email as part of the response, but getting a list of users (/admin/users/list/{flag}.json
) does. If you pass a parameter like username
, you can probably get the specific user.
Joe_F
(Joe Farrar)
28 Agosto 2025, 1:07pm
3
I want to get a full list of users, their activity on the community and have their email also, it seems it is not an option though.
pfaffman
(Jay Pfaffman)
28 Agosto 2025, 3:36pm
4
The data explorer plugin is probably the way to do that. And then you can request a particular query via the API.
Joe_F
(Joe Farrar)
2 Settembre 2025, 1:17pm
5
Thanks, I had not seen this before, but seems this is not possible there unless I am missing something!
pfaffman
(Jay Pfaffman)
2 Settembre 2025, 1:30pm
6
You could probably search here and find some examples or at ask.discourse.com , I asked
I’m unclear about who this link can work for:
https://ask.discourse.com/discourse-ai/ai-bot/shared-ai-conversations/oeofVCGwHrYuzKrtLV6PeQ
As an admin, create your query in /admin/plugins/explorer
. For example, to fetch username, email, and activity information:
SELECT
u.id AS user_id,
u.username,
u.email,
u.created_at,
u.last_seen_at,
u.active,
u.trust_level,
(
SELECT COUNT(*)
FROM posts p
WHERE p.user_id = u.id
) AS post_count,
(
SELECT COUNT(*)
FROM topics t
WHERE t.user_id = u.id
) AS topic_count
FROM users u
WHERE u.id > 0
ORDER BY u.created_at DESC
2. Run the Query via the API
Find your query ID in the Data Explorer UI.
Run your query using a POST request to /admin/plugins/explorer/queries/{query_id}/run
.
Example cURL:
curl -X POST "https://your-site-url/admin/plugins/explorer/queries/{query_id}/run" \
-H "Content-Type: application/json" \
-H "Api-Key: YOUR_API_KEY" \
-H "Api-Username: system" \
-d '{"params":{}}'
Results will be returned as JSON (default).
To remove extra relations data, add -F "download=true"
or equivalent.
3 Mi Piace