0

我正在使用 Google Admin SDK 并尝试设置 MailMonitor 进行审核。这是我目前正在使用的代码

            MailMonitor monitor = new MailMonitor();
            monitor.BeginDate = new DateTime(2013, 11, 8);
            monitor.EndDate = new DateTime(2013, 12, 30);
            monitor.IncomingEmailMonitorLevel = MonitorLevel.FULL_MESSAGE;
            monitor.OutgoingEmailMonitorLevel = MonitorLevel.FULL_MESSAGE;
            monitor.DraftMonitorLevel = MonitorLevel.FULL_MESSAGE;
            monitor.ChatMonitorLevel = MonitorLevel.FULL_MESSAGE;
            monitor.DestinationUserName = "adminUser";

            AuditService service = new AuditService("domain.com", "domain.com-auditapp-v1");
            service.setUserCredentials("adminUser@domain.com", "password");

            MailMonitor monitorEntry = service.CreateMailMonitor("userToMonitor", monitor);

当我运行此代码时,我收到 400 Bad Request 返回。我用于 adminUser 的凭据是正确的。我已经检查了三次。我究竟做错了什么?

4

1 回答 1

0

我想到了。这是因为BeginDate变量需要恰好在现在(到第二个),或者在未来的某个时间。该时间还需要转换为 UTC 时间才能正常工作。

于 2013-11-08T21:40:50.287 回答