none
Client UsageInfo "implementation specific period"

    Question

  • Trying to figure out what "an implementation specific period" means in the documentation for the Microsoft.SharePoint.Client.UsageInfo properties (https://msdn.microsoft.com/en-us/Library/microsoft.sharepoint.client.usageinfo_properties.aspx). This verbiage is used on the descriptions for Bandwidth, Hits, and Visits. In prior major versions of SharePoint, you could sometimes manipulate the usage period to get numbers for the period you were seeking. I can't find anything regarding the period for the UsageInfo class. At the very least, I need to know what the "implementation specific period" is. Best if I have some way to define it.
    Friday, March 20, 2015 11:15 PM

All replies

  • Curious that https://[tenant].sharepoint.com/_api/site/usage is returning 0 Hits and 0 Visits, but the Usage report at https://[tenant].sharepoint.com/_layouts/15/Reporting.aspx?Category=AnalyticsSiteCollection shows Hits and Visits greater than zero (0) for the previous day and other days within the last month.
    Tuesday, March 24, 2015 3:57 PM
  • Even the following, as used by the OfficeDev / PnP / Solutions / Governance.SiteUsageReport gives me zeroes for the Hits and Visits:

    clientContext.Load(site, s => s.Usage)
    clientContext.ExecuteQuery();

    Capturing the traffic for this query, you find that it is executing the following:

    POST https://[tenant]-admin.sharepoint.com/_vti_bin/client.svc/ProcessQuery

    Authorization: Bearer [bearer token]
    Body:
    <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="15" ObjectPathId="14" /><Query Id="16" ObjectPathId="14"><Query SelectAllProperties="true"><Properties><Property Name="Usage" ScalarProperty="true" /></Properties></Query></Query></Actions><ObjectPaths><Method Id="14" ParentId="1" Name="GetSiteByUrl"><Parameters><Parameter Type="String">https://[tenant].sharepoint.com/</Parameter></Parameters></Method><Identity Id="1" Name="[guid]|[guid]:[guid]&#xA;Tenant" /></ObjectPaths></Request>

    Is there something I need to activate on my SharePoint Online site to get these working?


    • Edited by PaulE Tuesday, March 24, 2015 4:57 PM Added verb for ProcessQuery.
    Tuesday, March 24, 2015 4:55 PM
  • Trying to find out the same thing, did you get any further?

    SharePoint architect / MCTS and MCPD SharePoint 2007 - 2013

    Monday, July 27, 2015 9:59 AM
  • Sadly, no response to my inquiries here or on three Yammer groups. For now, I've resorted to using a POST WebRequest to pull down the Excel document that does contain the information (Site Settings > Popularity and Search Reports > Usage) and DocumentFormat.OpenXml to read it (if I put together a blog post on how I did this, I'll post a link on this thread). I'm not very fond of this solution, though, because the ASPX pages don't support OAuth and, thus, I can't use app permissions to do it. I'd much rather be using an API than pretending to be a user with a browser.
    Monday, July 27, 2015 5:00 PM
  • Sadly, no response to my inquiries here or on three Yammer groups. For now, I've resorted to using a POST WebRequest to pull down the Excel document that does contain the information (Site Settings > Popularity and Search Reports > Usage) and DocumentFormat.OpenXml to read it (if I put together a blog post on how I did this, I'll post a link on this thread). I'm not very fond of this solution, though, because the ASPX pages don't support OAuth and, thus, I can't use app permissions to do it. I'd much rather be using an API than pretending to be a user with a browser.

    Hi Paul, could you share the code snippet to download the Excel-document? I am having trouble finding the correct  download-link.

    Thursday, August 06, 2015 1:05 PM
  • I've posted a blog all about programatically retrieving the hits and unique users (complete with code): https://spsawyer.wordpress.com/2015/08/10/spo-walkthrough_retrieving-usage-hits-and-unique-users
    Tuesday, August 11, 2015 10:56 PM