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

前端 未结 2 841
忘掉有多难
忘掉有多难 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));
    
    0 讨论(0)
  • 2020-12-07 07:17

    So I found out that for this to work, You need to make sure that you access the google.Admin account for referencing the service account Client ID of the app you created.

    Another thing that helps is making sure the timezone is in the following format "America/Phoenix"

    I have now successfully created events through the service account WITHOUT authentication.

    0 讨论(0)
提交回复
热议问题