If you need to include monitoring of Office 365 into your own custom applications, you can perform REST calls to Office 365 Admin reporting OData service, or in case that your app is .NET, you can use Office 365 Reporting Web Service Client Library. This library is published on NuGet, and it is Open Source, with full source code published on GitHub.
Initial release of the library did not provide any API to access reports related to SharePoint Online. So, when the library was published as Open Source, I made some contributions to the repository: I created several report definition classes for SharePoint Online and some reports related to connected clients.
Here is full list of new reports (which I contributed to the repo) which are added in versions 184.108.40.206 and 220.127.116.11 of the library:
Reports added in version 18.104.22.168
Reports added in version 22.214.171.124
When Client Library is used, process for data retrieval is as follows:
- Reporting Context is created and configured - with User Name, Password, and optional time interval for the report as parameters
- Logger and Report Visitor are initialized
- Reporting Stream object is created - it takes Reporting Context, name of the report and stream name as parameters.
- Method RetrieveData on Reporting Stream is called, with previously initialized Report Visitor as an argument. At this moment, data from the report is retrieved and processed, based on the ReportVisitor configuration.