首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法访问SPOOneDriveForBusinessFileActivity REST调用

无法访问SPOOneDriveForBusinessFileActivity REST调用
EN

Stack Overflow用户
提问于 2015-03-11 19:25:07
回答 1查看 69关注 0票数 0

我正在使用微软的o365 REST客户端库(https://github.com/Microsoft/o365rwsclient),并且能够让许多API调用正常工作,但在"SPOOneDriveForBusinessFileActivity“方面没有任何进展。而且,我没有在o365的https://reports.office365.com/ecp/reportingwebservice/reporting.svc web服务原子提要中看到它的广告。

下面是事件应该返回的描述:https://support.office.com/en-gb/article/Understanding-the-User-activity-logs-report-80d0b3b1-1ee3-4777-8c68-6c0dedf1f980

查看https://github.com/Microsoft/o365rwsclient/blob/master/TenantReport/SPOOneDriveForBusinessFileActivity.cs中的源代码,它似乎是一个有效的函数,但是当使用来自c#应用程序的o365rwsclient库时(下面),我得到了一个404错误(未找到URL)。

有什么好主意吗?该报告是否已实现(Powershell cmdlet或直接REST调用也是可接受的)-如果是,我如何访问它?

代码语言:javascript
复制
using Microsoft.Office365.ReportingWebServiceClient;
using System;

namespace O365ReportingDataExport
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            ReportingContext context = new ReportingContext();
            //If you enter invalid authentication information, Visual Studio will throw an exception.
            context.UserName = @"PUT YOUR OFFICE 365 USER EMAIL ADDRESS HERE";
            context.Password = @"PUT YOUR OFFICE 365 USER PASSWORD HERE";
            //FromDateTime & ToDateTime are optional, default value is DateTime.MinValue if not specified
            context.FromDateTime = DateTime.MinValue;
            context.ToDateTime = DateTime.MinValue;
            context.SetLogger(new CustomConsoleLogger());

            IReportVisitor visitor = new CustomConsoleReportVisitor();

            ReportingStream stream1 = new ReportingStream(context, "SPOOneDriveForBusinessFileActivity", "stream1");
            //Calls VisitReport 
            stream1.RetrieveData(visitor);

            Console.WriteLine("Press Any Key...");
            Console.ReadKey();
        }

        private class CustomConsoleLogger : ITraceLogger
        {
            public void LogError(string message)
            {
                Console.WriteLine(message);
            }

            public void LogInformation(string message)
            {
                Console.WriteLine(message);
            }
        }

        private class CustomConsoleReportVisitor : IReportVisitor
        {
            public override void VisitBatchReport()
            {
                foreach (ReportObject report in this.reportObjectList)
                {
                    VisitReport(report);
                }
            }

            public override void VisitReport(ReportObject record)
            {
                Console.WriteLine("Record: " + record.Date.ToString());
            }
        }
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-31 19:46:27

在与微软的O365支持团队交谈后,可以看到OneDrive for Business中的文件活动似乎是一个尚未部署的内部测试特性(因此能够在REST中看到它)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28995574

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档