[英]Google Calendar Api v3 quota exceeded
I'm having a problem with creating calendar events ( With a google service account ), I have the Domain-wide Delegation enabled.我在创建日历事件(使用 google 服务帐户)时遇到问题,我启用了域范围委派。
The error i'm getting is: "Message[Calendar usage limits exceeded.] Location[ - ] Reason[quotaExceeded] Domain[usageLimits]"我得到的错误是:“消息[超出日历使用限制。]位置[-]原因[quotaExceeded]域[usageLimits]”
I've checked the usage and its below 10 requests ( The quota is set to 1,000,000 )我检查了使用情况及其以下 10 个请求(配额设置为 1,000,000)
This is my code:这是我的代码:
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?以前有人遇到过这个问题吗?
This is a know bug这是一个已知错误
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):但是,这有当前的解决方法(除了不包括与会者):
Domain-Wide Delegation or impersonate a user域范围委派或模拟用户
You can read about how to do it here , the steps are:您可以在此处阅读有关如何操作的信息,步骤如下:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.