The enterprise that I work in has a hosted Discourse package for both Internal & External customers.
As an Admin on the Forum, I have some specific reporting functions to execute to generate Bi-weekly, Monthly and Annual user activity reports.
The fixed reporting periods (All_Time, Year, Quarter, Month, Week and Day) are useable however they are all linked to the Current_Date. Consequently I need to run specific Date_Range
01 January 20XX to 31 December 20XX reports and do so using the direct Search API and the Curl command.
Single_User reporting of Categories or a custom time range is simple however the fun begins when I attempt to use the
group_messages: groupname option or multiple options in the Curl command.
The current base command that I use for all of my searches is:
curl -i -sS -X GET -G “https://discuss.domainname.com/search.json” --data-urlencode
‘q=subject @username #questions after:2021-12-31’
| tail -n 1
| jq .topics
| sed “s|: "|:"|g”
| grep slug
| cut -d “"” -f4
Then the results get Bashed and Awked etc into a .CSV for easy importing into GoogleSheets.
In the Search documents, allegedly you can use multiple options within each Options category, so I could have
in:seen etc however I am unable to get more than one
in:option to produce a valid search.
The docs mention the use of
group_messages: groupname however if I used that option in the above Curl query I get zero results, and I have tried with many of the Groups on our forum.
Ideally I would like to run Curl searches to achieve the following reports:
small_team_name | Topics_Created | Replies_Posted | Date_Range
large_team_name | Topics_Created | Replies_Posted | Date_Range
Can someone give me some guidance please on what I may be doing wrong, or suggest a better method?