Google Calendar API的问题-403错误-C#

时间:2019-05-21 16:12:22

标签: c#-4.0 google-calendar-api

我正在尝试创建一个可以在授权日历上创建事件的小应用程序。这是我的C#代码:

        EventsResource.InsertRequest insertRequest = service.Events.Insert(new Event()
        {
            Description = "Pickup scheduled",
            Created = System.DateTime.Today,
            Start = new EventDateTime() { DateTime = DateTime.Today} , 
            Kind = "Pickup schedule for Tide",
            EndTimeUnspecified = true ,
            Location = "Your address",
            Visibility = "default" , 


        },

        "abc@gmail.com");
        return insertRequest.Execute();

但是我仍然出现此错误:

    Forbidden [403]
    Errors [
    Message[Forbidden] Location[ - ] Reason[forbidden] Domain[global]

各种帖子都建议删除token.json文件。我这样做了,然后看到该对话框提示我具有正确的权限:

enter image description here

所以,我现在完全不知所措。任何帮助将不胜感激。

0 个答案:

没有答案