超过了Google Calendar Api v3配额 [英] Google Calendar Api v3 quota exceeded

查看:62
本文介绍了超过了Google Calendar Api v3配额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建日历事件(使用google服务帐户)时遇到问题,我启用了域范围委托.

I'm having a problem with creating calendar events ( With a google service account ), I have the Domain-wide Delegation enabled.

我遇到的错误是:消息[超出日历使用限制.]位置[-]原因[quotaExceeded]域[usageLimits]"

The error i'm getting is: "Message[Calendar usage limits exceeded.] Location[ - ] Reason[quotaExceeded] Domain[usageLimits]"

我已经检查了使用情况及其以下10个请求(配额设置为1,000,000)

I've checked the usage and its below 10 requests ( The quota is set to 1,000,000 )

这是我的代码:

string[] Scopes = { CalendarService.Scope.Calendar, CalendarService.Scope.CalendarEvents };

using (var stream = new FileStream("cred.json", FileMode.Open, FileAccess.Read))
{
    GoogleCredential credential = GoogleCredential.FromStream(stream)
                                 .CreateScoped(Scopes);
    var service = new CalendarService(new BaseClientService.Initializer()
    {
        HttpClientInitializer = credential,
        ApplicationName = "TEST",
    });

    var ev = new Event();
    EventDateTime start = new EventDateTime();
    start.DateTime = DateTime.Now.AddMinutes(30);

    EventDateTime end = new EventDateTime();
    end.DateTime = DateTime.Now.AddMinutes(60);
    ev.Start = start;
    ev.End = end;
    ev.Summary = "Test";
    ev.Description = "Please Work";
    ev.Attendees = new List<EventAttendee>
    {
        new EventAttendee() { Email = "TestMail@gmail.com" }
    };

    var calendarId = "primary";
    service.Events.Insert(ev, calendarId).Execute();

如果我尝试在没有参加者的情况下执行代码,那么它将运行而没有任何错误.

If i try to execute the code without attendees it runs with out any error.

以前有人遇到过这个问题吗?

Did anyone encounter this problem before?

推荐答案

这是一个已知的错误

已在问题跟踪器中进行了报道.您可以单击问题编号旁边的星号,以使该错误具有更高的优先级并接收更新.

It has been reported on Issue tracker. You can click on the star next to the issue number to give more priority to the bug and to receive updates.

但是,这具有当前解决方法(除了不包括与会者):

However, this has the current workaround (aside from not including attendees):

整个域授权模拟用户

您可以在此处了解有关操作方法的信息.,步骤是:

You can read about how to do it here, the steps are:

  1. 在表中找到新创建的服务帐户.在下面操作,单击显示更多,然后单击编辑.
  2. 在服务帐户详细信息中,单击显示域范围的委派",然后确保启用G Suite域范围委派复选框为已检查.
  3. 如果您尚未配置应用的OAuth同意屏幕,则您必须先这样做,然后才能启用域范围的委派.跟着屏幕上的说明,以配置OAuth同意屏幕,然后重复上述步骤,然后重新选中该复选框.
  4. 单击保存"以更新服务帐户,然后返回到服务帐户.可以看到一个新列,即域范围的委托".点击查看客户ID,获取并记录客户ID.

这篇关于超过了Google Calendar Api v3配额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆