I want to access the admin report data from an HTTP API.
This post seems to indicate that something like this will work:
/admin/reports/posts.json
I am getting an 404 error now.
All the URLs like this, do not seem to work. /admin/reports/staff_logins.json
I can run the API commands from the Discourse API Documentation fine.
My main objective is to get this report:
/admin/reports/user_notes.json
I’m using GET with the Api-Key and Api_Username of an admin account.
Falco
(Falco)
20 أكتوبر 2022، 12:47ص
2
Can your share a cURL of the request you are currently issuing ?
Thank you for your help. Here is the curl script I am using
curl --request GET \
--url https://community.domain.com/admin/reports/staff_logins.json \
--header '"Api-Key": "stringForAPIKey"' \
--header '"Api-Username": "stringForUsername"' \
--header '"Content-Type": "application/json"'
I am getting a 404 error
Can you send me a curl script that works on your system?
I am using Discourse 2.9.0.beta10
The user is an admin.
The API key works for other API commands listed on the Discourse API Documentation site.
Thanks again.
إعجاب واحد (1)
Falco
(Falco)
21 أكتوبر 2022، 7:44م
4
I just did a test on Meta with
curl https://meta.discourse.org/admin/reports/staff_logins.json \
-H 'Api-Key: asdasdasdasd' \
-H 'Api-Username: Falco'
and it worked just fine for me. Can you try like that?
3 إعجابات
@Falco Wow. You’re the man. This solved my problems.
The source of my problem was that I am using a tool called Insomnia to test the API and I don’t have much experience with Insomnia.
Thanks for helping me. I was stuck for a week and I am grateful for your assistance. This also solved a different problem I was having with the user_notes reports.
إعجابَين (2)
system
(system)
تم إغلاقه في
20 نوفمبر 2022، 11:16م
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.