- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
12-05-2023 01:39 AM
Hi Support,
We want to get top all users for last 30 days using XML API, how we get it?
This is XML API to get top 10 users (Worked😞
<type><panorama-trsum><sortby>sessions</sortby><group-by>srcuser</group-by><aggregate-by><member>src</member><member>app</member></aggregate-by><values><member>sessions</member><member>bytes</member><member>nthreats</member></values></panorama-trsum></type><period>last-30-days/period><<topn>10</topn><topm><count>30</count></topm><caption>top-10-users-last-30-days</caption><description>Traffic Reports</description><device-group>{0}</device-group><query>(device-group eq '" . $deviceGroup . "') AND ( (srcuser neq '') )</query><runnow>yes</runnow>
This is the XML API for all users that I get from ChatGPT but it didn't work:
<type><panorama-trsum><sortby>sessions</sortby><group-by>srcuser</group-by><aggregate-by><member>src</member><member>app</member></aggregate-by><values><member>sessions</member><member>bytes</member><member>nthreats</member></values></panorama-trsum></type><period>last-30-days</period><caption>all-users-last-30-days</caption><description>TrafficReportsforAllUsers</description><device-group>{0}</device-group><query>(device-group eq '" . $deviceGroup . "') AND ( (srcuser neq '') )</query><runnow>yes</runnow>
And this is the XML API I get from XML API documentation:
/api/?type=report&async=yes&reporttype=predefined&reportname=top-users
this API only for 1 day.
I tried to modified the XML above, add start and end date for 1 month but it still only get for 1 day.
How to modified the XML API to get for last 30 days using API above?
Please advise
thank you
12-06-2023 06:18 AM
Hi @Fariq_Zaidi ,
Not sure about the XML API syntax for top users last 30 days.
That said, how about creating a custom report that gives you that exact information and then calling this custom report using XML API ?
/api/?type=report&async=yes&reporttype=custom&reportname=top-users-custom
Kind regards,
-Kim.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!