User reports via API?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

User reports via API?

Not applicable

I have been able to create a new user report via the API, but have not found a way to run the report and retreive the generated pdf.  Is this completely beyond the bounds of the API?

The reason I am trying to do this is because we have two separate user bases that need monitoring and action: students and faculty.  Each has it's own path to resolution involving different areas (Student Development for students, and HR for faculty/staff).  I would really like to give them rights to generate their own reports for users, but they would share the same reporting area, and be able to see reports for the user base they are not responsible for.  This is primarily a problem with the staff in Student Develpment being able to run reports on other faculty and staff.

So, I want to use the API to generate the user reports dynamically and on demand.  I can create a portlet in our portal that gives access to reports for specific users (ie. the ones that have already shown up in blocked URL reports) so that the person responsible can handle disputes that arise.  If the list only includes the users that they should be able to view, the portlet can create the user activity report on the fly, but I need a way to retreive the actual report.

I guess the second suggestion would be ACLs for managing access to reports.

1 ACCEPTED SOLUTION

Accepted Solutions

I believe you already have this worked out but here is an example of the xpath required to build a custom report and how to invoke it.

See this xpath example:

For configuration:

xpath=/config/shared/reports/entry[@name='testvsys']&element=<type><appstat><sortby>nbytes</sortby><group-by>category-of-name</group-by><aggregate-by><member>name</member></aggregate-by><values><member>nsess</member><member>nbytes</member></values></appstat></type><period>last-hour</period><topn>25</topn><topm>10</topm><query>(vsys eq vsys2)</query>

To invoke the report:

https://<YOUR-IP>/esp/restapi.esp?key=<YOUR-KEY>&type=report&reporttype=custom&reportname=testvsys

output:

<response status="success"><report logtype="appstat" start="2011/08/18 12:40:22" start-epoch="1313696422" end="2011/08/18 13:40:21" end-epoch="1313700021" generated-at="2011/08/18 13:40:22" generated-at-epoch="1313700022" axis="category-of-name"><entry><category-of-name>general-internet</category-of-name><name>web-browsing</name><nsess>184154</nsess><nbytes>2867152744</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>yahoo-toolbar</name><nsess>399061</nsess><nbytes>2744519666</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>flash</name><nsess>1981</nsess><nbytes>360290573</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>ping</name><nsess>702451</nsess><nbytes>74824382</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>rss</name><nsess>2208</nsess><nbytes>65049615</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>bittorrent</name><nsess>568</nsess><nbytes>63954077</nbytes></entry> ...

View solution in original post

8 REPLIES 8

L2 Linker

Hi,

I do not believe that you can invoke the 'export to pdf' function for a custom report via the XML API.  Why not just execute the report, collect the XML response and present it to the user in a web interface? Will that address what you are looking to accomplish?

Marc

I believe you already have this worked out but here is an example of the xpath required to build a custom report and how to invoke it.

See this xpath example:

For configuration:

xpath=/config/shared/reports/entry[@name='testvsys']&element=<type><appstat><sortby>nbytes</sortby><group-by>category-of-name</group-by><aggregate-by><member>name</member></aggregate-by><values><member>nsess</member><member>nbytes</member></values></appstat></type><period>last-hour</period><topn>25</topn><topm>10</topm><query>(vsys eq vsys2)</query>

To invoke the report:

https://<YOUR-IP>/esp/restapi.esp?key=<YOUR-KEY>&type=report&reporttype=custom&reportname=testvsys

output:

<response status="success"><report logtype="appstat" start="2011/08/18 12:40:22" start-epoch="1313696422" end="2011/08/18 13:40:21" end-epoch="1313700021" generated-at="2011/08/18 13:40:22" generated-at-epoch="1313700022" axis="category-of-name"><entry><category-of-name>general-internet</category-of-name><name>web-browsing</name><nsess>184154</nsess><nbytes>2867152744</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>yahoo-toolbar</name><nsess>399061</nsess><nbytes>2744519666</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>flash</name><nsess>1981</nsess><nbytes>360290573</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>ping</name><nsess>702451</nsess><nbytes>74824382</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>rss</name><nsess>2208</nsess><nbytes>65049615</nbytes></entry><entry><category-of-name>general-internet</category-of-name><name>bittorrent</name><nsess>568</nsess><nbytes>63954077</nbytes></entry> ...

Ha!  Yes, that is almost exactly what I am looking for.

I need to get an easy way to see the repeat counts for a particular recognizable site.  I can get a count for a destination IP, or resolved address but that is meaningless to the user, but not the actual hostname from the URL.  Yet, the user activity report includes this, which is why I was trying to find a way to run and retrieve it.

Can you share with me what language you are scripting in and a sample of the data output that you are looking for from a UAR?  That will help me to identify if there is another way to get that data and present it in a usable way.  We are also currently working on a Web Services SDK that may help you.  Here is a snippet of a widget that shows unique hits for URL filtering report using the XML API.

testoutweb.jpg

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!