Google API Calender v3 Event Insert via Service Account using Asp.Net MVC

前端 未结 2 842
忘掉有多难
忘掉有多难 2020-12-07 06:25

I have been trying to insert a Google calendar event via Google service account that was created for an app in my dev console, but I am continually getting a helpless 404 re

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 07:10

    I had the same problem. The solution was to add an email client, whose calendar event you want to send.

     Credential = new ServiceAccountCredential(
                new ServiceAccountCredential.Initializer(serviceAccountEmail)
                {
                    Scopes = Scopes,
                    User = "example_client_email@gmail.com" 
                }.FromCertificate(certificate));
    

提交回复
热议问题