Google Calendar Connector
Documentation
Version: 6
Documentation

Google Calendar Connector - Source Code


<?xml version="1.0" encoding="utf-8"?>
<ApiConfig Name="Google Calendar"
           Desc="Read / write Google Calendar data inside your app; perform many Google Calendar operations without coding, just using easy to use high performance API Connector for Google Calendar"
           Slug="google-calendar-connector"
           Id="4ebd0208-8328-5d69-8c44-ec50939c0967"
           Logo="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBaRXhpZgAATU0AKgAAAAgABQMBAAUAAAABAAAASgMDAAEAAAABAAAAAFEQAAEAAAABAQAAAFERAAQAAAABAAAOw1ESAAQAAAABAAAOwwAAAAAAAYagAACxj//bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAMgAyAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZ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jyw1m/w82Gq6rc6xefabnYGChFVBgKB/wDXJP41Roor00klZHxU5ynJyk7thRRRTJN3QdebTnFvcEtaMfqYz6j29R+P17O2vLa8TdbTxyjAJ2tkjPTI7fjRRXs5ZiajfsnseXj6EEvaLcnooor2zyQrrfAX/IRuv+uQ/nRRXi8R/wDIrren6o9HKv8AfKfr+h3tFFFfjZ96FFFFABRRRQAUUUUAFFFFABRRRQAVwPxF1S30oxTzyIGELGOMtgyEHoPxI+maKK9HKoqWKimUq0qKlUjukzwjU9SuNWvmurjG9gAFXO1QOwyTj1+pNU6KK+4SSVkfNznKcnKTu2FFFFMkKKKKAP/Z"
           Version="6"
           EngineVersion="4"
>
  <VersionHistory>
	<Change Ver="6" Date="2025-01-28" Type="New">Added ImpersonateAs property for Service Account authentication (Requires Domain-wide delegation ON and needs Google Workspace account)</Change>
     <Change Ver="6" Date="2025-01-28" Type="New">Added images in User Account and Service Account authentication instructions</Change>      
     <Change Date="2024-06-05" Type="New">Added Redirect URL property to support Web Application credentials (visible when show advanced option checked)</Change>
     <Change Date="2022-10-13" Type="Modified">Added retry logic on error code 429 (Too many requests).</Change>
     <Change Date="2021-11-26">Initial version</Change>
  </VersionHistory>

  <ServiceUrls>
    <ServiceUrl Name="Google Calendar API v3" Url="https://www.googleapis.com/calendar/v3/" />
  </ServiceUrls>
  <Auths>
    <Auth Name="OAuth" 
          Label="User Account" 
          Desc="User accounts represent a developer, administrator, or any other person who interacts with Google APIs and services. User accounts are managed as Google Accounts, either with Google Workspace or Cloud Identity. They can also be user accounts that are managed by a third-party identity provider and federated with Workforce Identity Federation."          
          HelpLink="https://cloud.google.com/docs/authentication#user-accounts"
          Type="OAuth" 
          ConnStr="Provider=Google;ScopeSeparator={space};"
          TestEndPoint="list_calendars">
      <Params>
        <Param Name="UseCustomApp" Value="True" Required="True" Hidden="False" Desc="Use your own app credentials or inbuilt app provided by ZappySys for ease of use. If you choose UseCustomApp=true then make sure to obtain your own ClientId and Secret using steps provided (Click [Steps to Configure] link found next to Authentication Type dropdown)" />
        <Param Name="ClientId" VisibleIf="UseCustomApp" RequiredIf="UseCustomApp"/>
        <Param Name="ClientSecret" Secret="True" VisibleIf="UseCustomApp" RequiredIf="UseCustomApp" />
        <Param Name="Scope" Value="https://www.googleapis.com/auth/calendar" />              
        <Param Name="RetryMode" Value="RetryWhenStatusCodeMatch" Options="None;RetryAny;RetryWhenStatusCodeMatch;" Hidden="True" />
        <Param Name="RetryStatusCodeList" Value="403|429" Hidden="True" />
        <Param Name="RetryCountMax" Value="5" Hidden="True" />
        <Param Name="RetryMultiplyWaitTime" Value="True" Hidden="True" />  
        <Param Name="ReturnUrl" Label="Redirect URL (Only for Web App)" Options=";https://zappysys.com/oauth/" VisibleIf="UseCustomApp" Desc="Only specifiy this if you have created Credential as Web Application rather than Desktop. In Desktop App you dont have to supply Return URL (its always localhost). When you keep this blank it uses default value http://localhost:[some_random_port_each_time] for redirect_url)"  />
      </Params>
      <Notes>
        <![CDATA[
<p>
    Follow these steps on how to create Client Credentials (User Account principle) to authenticate and access Google Calendar API in SSIS package or ODBC data source:
</p>
<div class="alert alert-warning">
    <strong>WARNING</strong>: 
    
    If you are planning to automate processes, we recommend that you use a <em>Service Account</em> authentication method.    
    In case, you still need to use <em>User Account</em>, then make sure you use a system/generic account (e.g. <code>automation@my-company.com</code>).
    When you use a personal account which is tied to a specific employee profile and that employee leaves the company, 
    the token may become invalid and any automated processes using that token will start to fail.   
</div> 
    
<h3>Step-1: Create project</h3>
<p>
    This step is optional, if you already have a project in Google Cloud and can use it.
    However, if you don't, proceed with these simple steps to create one:
</p>
<ol>
     <li>
          <p>
             First of all, go to <a target="_blank" href="https://console.developers.google.com/">Google API Console</a>.
          </p>
     </li>
	<li>
          <p>
             Then click <strong>Select a project</strong> button and then click <strong>NEW PROJECT</strong> button:
          </p>
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/start-creating-new-project-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Start creating a new project in Google Cloud"
		     title="Starting creating a new project in Google Cloud"
		     width="1000"
		     height="340" />
	</li>
	<li>
          <p>
             Name your project and click <strong>CREATE</strong> button:
          </p>
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/create-new-project-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Create a new project in Google Cloud"
		     title="Creating a new project in Google Cloud"
		     width="680"
		     height="360" />
	</li>
	<li>
          <p>
             Wait until the project is created:
          </p>          
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/wait-until-project-is-created-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Wait until project is created in Google Cloud"
		     title="Waiting until project is created in Google Cloud"
		     width="640"
		     height="390" />
	</li>
     <li>
        Done! Let's proceed to the next step.
     </li>
</ol>



<h3>Step-2: Enable Google Calendar API</h3>
<p>
    In this step we will enable Google Calendar API:
</p>
<ol>
	<li>
          <p>
             Select your project on the top bar:
          </p>          
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/select-project-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Select project in Google Cloud"
		     title="Selecting project in Google Cloud"
		     width="1000"
		     height="400" />
	</li>
     <li>
          <p>
              Then click the <strong>"hamburger"</strong> icon on the top left and access 
              <a target="_blank" href="https://console.cloud.google.com/apis/dashboard">APIs & Services</a>:
          </p>
          <img src="https://cdn.zappysys.com/api/Images/authentication/google/access-apis-and-services-in-google-cloud.png"
               loading="lazy"
               decoding="async"
               class="img-thumbnail block"
               alt="Access APIs and services in Google Cloud"
               title="Accessing APIs and services in Google Cloud"
               width="990"
               height="440" />
    </li>
    <li>
        <p>
            Now let's enable several APIs by clicking <strong>ENABLE APIS AND SERVICES</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/enable-api-for-project-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Enable API for project in Google Cloud"
             title="Enabling API for project in Google Cloud"
             width="800"
             height="300" />
    </li>
    <li>
        <p>
            In the search bar search for <code>calendar</code> and then locate and select <strong>Google Calendar API</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/search-for-api-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Search for API in Google Cloud"
             title="Searching for API in Google Cloud"
             width="1000"
             height="390" />
    </li>
    <li>
        <p>
            Enable <strong>Google Calendar API</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/enable-google-calendar-api.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Enable Google Calendar API"
             title="Enabling Google Calendar API"
             width="620"
             height="350" />
    </li>
    <li>
        Done! Let's proceed to the next step.
    </li>    
</ol>



<h3>Step-3: Create OAuth application</h3>
<ol>
    <li>
        <p>
            First of all, click the <strong>"hamburger"</strong> icon on the top left and then hit <strong>VIEW ALL PRODUCTS</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/view-all-products-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="View all products in Google Cloud"
             title="Viewing all products in Google Cloud"
             width="990"
             height="700" />
    </li>
    <li>
        <p>
            Then access 
            <a target="_blank" href="https://console.cloud.google.com/auth">Google Auth Platform</a>
            to start creating an OAuth application:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/open-google-auth-platform-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Open Google Auth Platform in Google Cloud"
             title="Opening Google Auth Platform in Google Cloud"
             width="1000"
             height="430" />
    </li>
    <li>
        <p>
            Start by pressing <strong>GET STARTED</strong> button:
        </p>        
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/start-creating-app-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Start creating an app in Google Cloud"
             title="Starting creating an app in Google Cloud"
             width="1000"
             height="340" />
    </li>    
    <li>
        <p>
            Next, continue by filling in <strong>App name</strong> and <strong>User support email</strong> fields:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/fill-app-info-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Fill app info in Google Cloud"
             title="Filling app info in Google Cloud"
             width="850"
             height="440" />
    </li>
    <li>
        <p>
            Choose <strong>Internal</strong> option, if it's enabled, otherwise select <strong>External</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/choose-app-audience-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Choose app audience in Google Cloud"
             title="Choosing app audience in Google Cloud"
             width="850"
             height="590" />
    </li>
    <li>
        <p>
            <em>Optional step if you used <code>Internal</code> option in the previous step</em>. 
            Nevertheless, if you had to use <code>External</code> option, then click <strong>ADD USERS</strong> to add a user:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/add-test-user-in-google-cloud-app.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Add test user in Google Cloud app"
             title="Adding test user in Google Cloud app"
             width="1000"
             height="990" />
    </li>
    <li>
        <p>
            Then add your contact <strong>Email address</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/enter-app-contact-info-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Enter app contact info in Google Cloud"
             title="Entering app contact info in Google Cloud"
             width="850"
             height="510" />
    </li>
    <li>
        <p>
            Finally, check the checkbox and click <strong>CREATE</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/create-app-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Create app in Google Cloud"
             title="Creating app in Google Cloud"
             width="850"
             height="580" />
    </li>
    <li>
        Done! Let's create Client Credentials in the next step.
    </li>
</ol>



<h3>Step-4: Create Client Credentials</h3>
<ol>
    <li>        
        <p>
            In 
            <a target="_blank" href="https://console.cloud.google.com/auth">Google Auth Platform</a>, 
            select <strong>Clients</strong> menu item and click <strong>CREATE CLIENT</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/start-creating-app-client-in-google-cloud.png"
	       loading="lazy"
	       decoding="async"
	       class="img-thumbnail block"
	       alt="Start creating app client in Google Cloud"
	       title="Starting creating app client in Google Cloud"
	       width="1000"
	       height="340" />
    </li>
    <li>
        <p>
            Choose <code>Desktop app</code> as <strong>Application type</strong> and name your credentials:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/create-oauth-app-client-in-google-cloud.png"
	       loading="lazy"
	       decoding="async"
	       class="img-thumbnail block"
	       alt="Create OAuth app client in Google Cloud"
	       title="Creating OAuth app client in Google Cloud"
	       width="1000"
	       height="500" />
    </li>
    <li>
        <p>
            Continue by opening the created credentials:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/view-app-client-credentials-in-google-cloud.png"
	       loading="lazy"
	       decoding="async"
	       class="img-thumbnail block"
	       alt="View app client credentials in Google Cloud"
	       title="Viewing app client credentials in Google Cloud"
	       width="1000"
	       height="370" />
    </li>
    <li>
        <p>
            Finally, copy <strong>Client ID</strong> and <strong>Client secret</strong> for the later step:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/user-account/use-client-id-and-secret-to-read-google-rest-api-data.png"
	       loading="lazy"
	       decoding="async"
	       class="img-thumbnail block"
	       alt="Use client ID and secret to read Google REST API data"
	       title="Using client ID and secret to read Google REST API data"
	       width="770"
	       height="360" />
    </li>
    <li>  
        Done! We have all the data needed for authentication, let's proceed to the last step!
    </li>    
</ol>




<h3>Step-5: Configure connection</h3>
<ol>
    <li>
        <p>
            Now go to SSIS package or ODBC data source and use previously copied values in <strong>User Account</strong> authentication configuration:
        </p>
	   <ul>
            <li>In the <strong>ClientId</strong> field paste the <strong>Client ID</strong> value.</li>
            <li>In the <strong>ClientSecret</strong> field paste the <strong>Client secret</strong> value.</li>            
        </ul>
    </li>
    <li>
        <p>
            Press <strong>Generate Token</strong> button to generate Access and Refresh Tokens.
        </p>
    </li>
    <li>
        <p>
            Finally, click <strong>Test Connection</strong> to confirm the connection is working.
        </p>
    </li>
    <li>
        Done! Now you are ready to use Google Calendar Connector!
    </li>        
</ol>             
        ]]>
      </Notes>        
    </Auth>

    <Auth Name="ServiceAccount" 
          Label="Service Account" 
          Desc="Service accounts are accounts that do not represent a human user. They provide a way to manage authentication and authorization when a human is not directly involved, such as when an application needs to access Google Cloud resources. Service accounts are managed by IAM."
          HelpLink="https://cloud.google.com/docs/authentication#service-accounts"
          Type="OAuth" 
          ConnStr="Provider=Google;UseCustomApp=True;UseClientCertificate=True;CertificateStorageType=PfxFile;CertificatePath=[$PrivateKeyPath$];GrantType=ClientCredentials;"
          TestEndPoint="list_calendars">
      <Params>
        <Param Name="ClientId" Label="Service Account Email" Desc="This is service account email ID (e.g. some_name@my_project.iam.gserviceaccount.com)" Required="True" />
        <Param Name="PrivateKeyPath" Label="Service Account Private Key Path (i.e. *.p12)" Desc="File path for p12 file (i.e. Private Key file for service account). Keep this key file secure" Required="True" />
        <Param Name="Scope" Value="https://www.googleapis.com/auth/calendar" />          
        <Param Name="RetryMode" Value="RetryWhenStatusCodeMatch" Options="None;RetryAny;RetryWhenStatusCodeMatch;" Hidden="True" />
        <Param Name="RetryStatusCodeList" Value="403|429" Hidden="True" />
        <Param Name="RetryCountMax" Value="5" Hidden="True" />
        <Param Name="RetryMultiplyWaitTime" Value="True" Hidden="True" />   
		<Param Name="ImpersonateAs" Type="Property" Key="ExtraAttributesForTokenRequest" Hidden="False" ValueTemplate="user={$value$}" Label="Impersonate As (Enter Email Id)" />
      </Params>

      <Notes>
        <![CDATA[
<p>
    Follow these steps on how to create Service Account to authenticate and access Google Calendar API in SSIS package or ODBC data source:    
</p>

<h3>Step-1: Create project</h3>
<p>
    This step is optional, if you already have a project in Google Cloud and can use it.
    However, if you don't, proceed with these simple steps to create one:
</p>
<ol>
     <li>
          <p>
             First of all, go to <a target="_blank" href="https://console.developers.google.com/">Google API Console</a>.
          </p>
     </li>
	<li>
          <p>
             Then click <strong>Select a project</strong> button and then click <strong>NEW PROJECT</strong> button:
          </p>
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/start-creating-new-project-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Start creating a new project in Google Cloud"
		     title="Starting creating a new project in Google Cloud"
		     width="1000"
		     height="340" />
	</li>
	<li>
          <p>
             Name your project and click <strong>CREATE</strong> button:
          </p>
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/create-new-project-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Create a new project in Google Cloud"
		     title="Creating a new project in Google Cloud"
		     width="680"
		     height="360" />
	</li>
	<li>
          <p>
             Wait until the project is created:
          </p>          
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/wait-until-project-is-created-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Wait until project is created in Google Cloud"
		     title="Waiting until project is created in Google Cloud"
		     width="640"
		     height="390" />
	</li>
     <li>
        Done! Let's proceed to the next step.
     </li>
</ol>



<h3>Step-2: Enable Google Calendar API</h3>
<p>
    In this step we will enable Google Calendar API:
</p>
<ol>
	<li>
          <p>
             Select your project on the top bar:
          </p>          
		<img src="https://cdn.zappysys.com/api/Images/authentication/google/select-project-in-google-cloud.png"
		     loading="lazy"
		     decoding="async"
		     class="img-thumbnail block"
		     alt="Select project in Google Cloud"
		     title="Selecting project in Google Cloud"
		     width="1000"
		     height="400" />
	</li>
     <li>
          <p>
              Then click the <strong>"hamburger"</strong> icon on the top left and access 
              <a target="_blank" href="https://console.cloud.google.com/apis/dashboard">APIs & Services</a>:
          </p>
          <img src="https://cdn.zappysys.com/api/Images/authentication/google/access-apis-and-services-in-google-cloud.png"
               loading="lazy"
               decoding="async"
               class="img-thumbnail block"
               alt="Access APIs and services in Google Cloud"
               title="Accessing APIs and services in Google Cloud"
               width="990"
               height="440" />
    </li>
    <li>
        <p>
            Now let's enable several APIs by clicking <strong>ENABLE APIS AND SERVICES</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/enable-api-for-project-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Enable API for project in Google Cloud"
             title="Enabling API for project in Google Cloud"
             width="800"
             height="300" />
    </li>
    <li>
        <p>
            In the search bar search for <code>calendar</code> and then locate and select <strong>Google Calendar API</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/search-for-api-in-google-cloud.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Search for API in Google Cloud"
             title="Searching for API in Google Cloud"
             width="1000"
             height="390" />
    </li>
    <li>
        <p>
            Enable <strong>Google Calendar API</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/enable-google-calendar-api.png"
             loading="lazy"
             decoding="async"
             class="img-thumbnail block"
             alt="Enable Google Calendar API"
             title="Enabling Google Calendar API"
             width="620"
             height="350" />
    </li>
    <li>
        Done! Let's proceed to the next step.
    </li>    
</ol>



<h3>Step-3: Create Service Account</h3>
<p>
    Use the steps below to create a Service Account in Google Cloud:
</p>
<ol>    
    <li>
        <p>
            First of all, go to 
            <a target="_blank" href="https://console.cloud.google.com/iam-admin/iam">IAM & Admin</a> 
            in Google Cloud console:
        </p>
        
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/access-iam-and-admin-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Access IAM & Admin in Google Cloud" 
             title="Accessing IAM & Admin in Google Cloud" 
             width="690" 
             height="510" /> 
    </li>
    <li>        
        <p>
            Once you do that, click <strong>Service Accounts</strong> on the left side 
            and click <strong>CREATE SERVICE ACCOUNT</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/start-creating-service-account-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Start creating service account in Google Cloud" 
             title="Starting creating service account in Google Cloud" 
             width="1000" 
             height="500" /> 
    </li>
    <li>
        <p>
            Then name your service account and click <strong>CREATE AND CONTINUE</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/create-service-account-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Create service account in Google Cloud" 
             title="Creating service account in Google Cloud" 
             width="750" 
             height="450" /> 
    </li>
    <li>
        <p>
            Continue by clicking <strong>Select a role</strong> dropdown 
            and start granting service account Project Viewer roles:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/start-granting-service-account-project-roles-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Start granting service account project roles in Google Cloud" 
             title="Starting granting service account project roles in Google Cloud" 
             width="750" 
             height="250" /> 
    </li>     
    <li>
        <p>
            Find <strong>Project</strong> group 
            and select <strong>Viewer</strong> role:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/grant-service-account-project-viewer-role.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Grant service account project viewer role" 
             title="Granting service account project viewer role" 
             width="540" 
             height="410" />                  
    </li>
    <li>
        <p>
            Finish adding roles by clicking <strong>CONTINUE</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/finish-granting-service-account-project-roles-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Finish granting service account project roles in Google Cloud" 
             title="Finishing granting service account project roles in Google Cloud" 
             width="750" 
             height="370" /> 
            
        <div class="alert alert-info alert-title">
            You can always add or modify permissions later in 
            <a target="_blank" href="https://console.cloud.google.com/iam-admin/iam">IAM & Admin</a>.
        </div>
    </li>
    <li>
        <p>
            Finally, in the last step, just click button <strong>DONE</strong>:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/finish-configuring-service-account-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Finish configuring service account in Google Cloud" 
             title="Finishing configuring service account in Google Cloud" 
             width="750" 
             height="350" /> 
    </li>
    <li>
        <p>
            Done! We are ready to add a Key to this service account in the next step.
        </p>
    </li>        
</ol>



<h3>Step-4: Add Key to Service Account</h3>
<p>
    We are ready to add a Key (P12 certificate) to the created Service Account:
</p>
<ol>    
    <li>
        <p>
            In <a target="_blank" href="https://console.cloud.google.com/iam-admin/serviceaccounts">Service Accounts</a>
            open newly created service account:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/open-service-account-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Open service account in Google Cloud" 
             title="Opening service account in Google Cloud" 
             width="750" 
             height="350" /> 
    </li>    
    <li>
        <p>
            Next, copy email address of your service account for the later step:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/copy-service-account-email-address-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Copy service account email address in Google Cloud" 
             title="Copying service account email address in Google Cloud" 
             width="600" 
             height="370" /> 
    </li>
    <li>
        <p>
            Continue by selecting <strong>KEYS</strong> tab, 
            then press <strong>ADD KEY</strong> dropdown, 
            and click <strong>Create new key menu</strong> item:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/start-creating-key-for-service-account-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Start creating key for service account in Google Cloud" 
             title="Starting creating key for service account in Google Cloud" 
             width="750" 
             height="530" /> 
    </li>
    <li>
        <p>
            Finally, select <strong>P12</strong> option and hit <strong>CREATE</strong> button:
        </p>
        <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/create-p12-key-for-service-account-in-google-cloud.png" 
             loading="lazy" 
             decoding="async" 
             class="img-thumbnail block" 
             alt="Create P12 key for service account in Google Cloud" 
             title="Creating P12 key for service account in Google Cloud" 
             width="600" 
             height="400" /> 
    </li>    
    <li>
        P12 certificate downloads into your machine. We have all the data needed for authentication, let's proceed to the last step!
    </li>
</ol>



<h3>Step-5: Share Google Calendar with Service Account</h3>
<p>
    Now it's time to grant Google Calendar read/write permissions to the created service account:
</p>
<ol>
      <li>Login to https://calendar.google.com with Google account credentials whose calendar you want to share with the service account.</li>
      <li>On the top right click <strong>gear icon</strong> and click <strong>Settings</strong> item to open configuration.</li>
      <li>Then on the left, click <strong>Settings of my calendars</strong> section.</li>
      <li>Locate the calendar you want to share and select it.</li>   
      <li>In the dropdown hit <strong>Share with specific people or groups</strong> and click <strong>Add people and groups</strong> button.</li>
      <li>Enter the service account email address we obtained in the previous section.</li>
      <li>Finally, choose the permissions, e.g. <code>Make changes to events</code>:</li>
            <li>
                <img src="https://cdn.zappysys.com/api/Images/authentication/google/Service-Account/share-google-calendar-with-service-account.png" 
                        loading="lazy" 
                        decoding="async" 
                        class="img-thumbnail block" 
                        alt="Share Google Calendar with service account" 
                        title="Sharing Google Calendar with service account" 
                        width="930" 
                        height="480" /> 
            </li>
      <li>Click <strong>Send</strong> button to share the calendar.</li>    
      <li>That's it! Let's proceed to the configuration!</li>
</ol>



<h3>Step-6: Configure connection</h3>
<ol>
    <li>
        <p>
            Now go to SSIS package or ODBC data source and configure these fields in <strong>Service Account</strong> authentication configuration:
        </p>
	   <ul>
            <li>In the <strong>Service Account Email</strong> field paste the service account <strong>Email address</strong> value you copied in the previous step.</li>        
            <li>In the <strong>Service Account Private Key Path (i.e. *.p12)</strong> field use downloaded certificate's file path.</li>
       </ul>
    </li>
    <li>
        Done! Now you are ready to use Google Calendar Connector!
    </li>
</ol>

]]>
      </Notes>
    </Auth>

  
  </Auths>


  <Template> 
  </Template>

  <EndPoints>
    <!--=====================================
        ========= LIST CALENDARS ============
        =====================================-->  
    <EndPoint Name="list_calendars" 
              Label="List calendars"
              Desc="Lists calendars"
	         Url="/users/me/calendarList" 
              Method="GET"
              Filter="$.items"
              CachedTtl="0">
        <OutputColumns>
            <Column Name="id" Label="Id" DataType="DT_WSTR" Length="300" />
            <Column Name="summary" Label="Summary" DataType="DT_WSTR" Length="300" />
            <Column Name="description" Label="Description" DataType="DT_WSTR" Length="1500" />
            <Column Name="timeZone" Label="TimeZone" DataType="DT_WSTR" Length="300" />
        </OutputColumns>                  
    </EndPoint>

    <!--=====================================
        =========== LIST EVENTS =============
        =====================================-->  
    <EndPoint Name="list_events" 
              Label="List events" 
              Desc="Lists events"
	         Url="/calendars/[$CalendarId$]/events"
              Method="GET"
              Filter="$.items"
              >    
        <Params>
            <Param Name="CalendarId"
                   OptionsEndPoint="list_calendars"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>
            
            <Param Name="NextUrlAttributeOrExpr"
                    Value="$.nextPageToken"
                    Type="Property"
            />
            <Param Name="NextUrlSuffix"
                    Value="pageToken=&lt;%nextlink%&gt;"
                    Type="Property"
            />                    
        </Params>      
        <OutputColumns>
            <Column Name="id" Label="Id" DataType="DT_WSTR" Length="300" />
            <Column Name="kind" Label="Kind" DataType="DT_WSTR" Length="300" />
            <Column Name="status" Label="Status" DataType="DT_WSTR" Length="300" />
            <Column Name="htmlLink" Label="HtmlLink" DataType="DT_WSTR" Length="1000" />
            <Column Name="created" Label="CreatedAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="updated" Label="UpdatedAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="summary" Label="Summary" DataType="DT_WSTR" Length="300" />
            <Column Name="description" Label="Description" DataType="DT_WSTR" Length="4000" />
            <Column Name="creator.email" Label="CreatorEmail" DataType="DT_WSTR" Length="300" />
            <Column Name="organizer.email" Label="OrganizerEmail" DataType="DT_WSTR" Length="300" />
            <Column Name="organizer.displayName" Label="OrganizerDisplayName" DataType="DT_WSTR" Length="300" />

            <Column Name="start.dateTime" Label="StartsAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="start.timeZone" Label="StartTimeZone" DataType="DT_WSTR" Length="300" />
            <Column Name="end.dateTime" Label="EndsAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="end.timeZone" Label="EndTimeZone" DataType="DT_WSTR" Length="300" />
            <Column Name="attendees" Label="Attendees" DataType="DT_NTEXT"/>
        </OutputColumns>                      
    </EndPoint>    

    <!--=====================================
        ============ GET EVENT ==============
        =====================================-->  
    <EndPoint Name="get_event" 
              Label="Get event" 
              Desc="Gets event"
	          Url="/calendars/[$CalendarId$]/events/[$EventId$]"
              Method="GET"
              >    
        <Params>
            <Param Name="CalendarId"
                   OptionsEndPoint="list_calendars"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>
            <Param Name="EventId"
                   OptionsEndPoint="list_events"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   OptionEndPointParameters="CalendarId=[$CalendarId$];"
                   Required="True"/>                   
        </Params>      
        <OutputColumns>
            <Column Name="id" Label="Id" DataType="DT_WSTR" Length="300" />
            <Column Name="kind" Label="Kind" DataType="DT_WSTR" Length="300" />
            <Column Name="status" Label="Status" DataType="DT_WSTR" Length="300" />
            <Column Name="htmlLink" Label="HtmlLink" DataType="DT_WSTR" Length="1000" />
            <Column Name="created" Label="CreatedAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="updated" Label="UpdatedAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="summary" Label="Summary" DataType="DT_WSTR" Length="300" />
            <Column Name="description" Label="Description" DataType="DT_WSTR" Length="4000" />
            <Column Name="creator.email" Label="CreatorEmail" DataType="DT_WSTR" Length="300" />
            <Column Name="organizer.email" Label="OrganizerEmail" DataType="DT_WSTR" Length="300" />
            <Column Name="organizer.displayName" Label="OrganizerDisplayName" DataType="DT_WSTR" Length="300" />
            <Column Name="start.dateTime" Label="StartsAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="start.timeZone" Label="StartTimeZone" DataType="DT_WSTR" Length="300" />
            <Column Name="end.dateTime" Label="EndsAt" DataType="DT_DBTIMESTAMP" />
            <Column Name="end.timeZone" Label="EndTimeZone" DataType="DT_WSTR" Length="300" />
            <Column Name="attendees" Label="Attendees" DataType="DT_NTEXT"/>
        </OutputColumns>                                    
    </EndPoint>      

    <!--=====================================
        =========== CREATE EVENT ============
        =====================================-->  
    <EndPoint Name="create_event" 
              Label="Create event" 
              Desc="Creates event"
	          Url="/calendars/[$CalendarId$]/events"
              Method="POST"
              DotAsPath="True"
              ContentType="application/json"
              JsonRowFormat="Multicontent"
              >    
        <Params>
            <Param Name="CalendarId"
                   OptionsEndPoint="list_calendars"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>
        </Params>      
        <Body><![CDATA[{$rows$}]]></Body>
        <InputColumns>
            <Column Name="start.date" Label="StartsOn" Desc="Use StartsOn OR StartsAt" Example="2021-12-24" DataType="DT_DBDATE" />
            <Column Name="start.dateTime" Label="StartsAt" Desc="Use StartsOn OR StartsAt" Example="2021-12-24T18:30:00" DataType="DT_DBTIMESTAMP" />
            <Column Name="start.timeZone" Label="StartsInTimeZone" DataType="DT_WSTR" Length="300" />
            <Column Name="end.date" Label="EndsOn" DataType="DT_DBDATE" Example="2021-12-24"/>
            <Column Name="end.dateTime" Label="EndsAt" DataType="DT_DBTIMESTAMP" Example="2021-12-24T18:30:00" />
            <Column Name="end.timeZone" Label="EndsInTimeZone" DataType="DT_WSTR" Length="300" />
            <Column Name="attachments.fileUrl" Label="Kind" DataType="DT_WSTR" Length="300" />
            <Column Name="attendees" Label="Attendees" DataType="DT_NTEXT"/>
            <Column Name="description" Label="Description" DataType="DT_WSTR" Length="4000" />
            <Column Name="guestsCanInviteOthers" Label="GuestsCanInviteOthers" DateType="DT_BOOL" />
            <Column Name="guestsCanModify" Label="GuestsCanModify" DateType="DT_BOOL" />
            <Column Name="guestsCanSeeOtherGuests" Label="GuestsCanSeeOtherGuests" DateType="DT_BOOL" />
            <Column Name="location" Label="Location" DateType="DT_WSTR" Length="1024" />
            <Column Name="recurrence" Label="Recurrence" HelpLink="https://developers.google.com/calendar/api/v3/reference/events/insert" DataType="DT_WSTR" Length="1024"/>
            <Column Name="status" Label="Status" DataType="DT_WSTR" Length="50" Example="confirmed OR tentative OR cancelled"/>
            <Column Name="summary" Label="Summary" DataType="DT_WSTR" Length="300" />
            <Column Name="transparency" Label="Transparency" DataType="DT_WSTR" Length="300" Example="opaque OR transparent"/>
            <Column Name="visibility" Label="Visibility" DataType="DT_WSTR" Length="300" Example="default OR public OR private OR confidential"/>            
        </InputColumns>                                    
        <OutputColumns>
            <Column Name="id" Label="Id" DataType="DT_WSTR" Length="50" />
            <Column Name="status" Label="Status" DataType="DT_WSTR" Length="50" />
            <Column Name="created" Label="Created" DataType="DT_DBTIMESTAMP"/>
            <Column Name="updated" Label="Updated" DataType="DT_DBTIMESTAMP"/>
            <Column Name="htmlLink" Label="HtmlLink" DataType="DT_WSTR" Length="4000"/>
            <Column Name="iCalUID" DataType="DT_WSTR" Length="1024"/>
            <Column Name="eventType" DataType="DT_WSTR" Length="128"/>
        </OutputColumns>
    </EndPoint>    

    <!--=====================================
        =========== DELETE EVENT ============
        =====================================-->  
    <EndPoint Name="delete_event" 
              Label="Delete event" 
              Desc="Deletes event"
	          Url="/calendars/[$CalendarId$]/events/[$EventId$]"
              Method="DELETE"
              DotAsPath="True"
              ContentType="application/json"
              JsonRowFormat="Multicontent"
              >    
        <Params>
            <Param Name="CalendarId"
                   OptionsEndPoint="list_calendars"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>
            <Param Name="EventId"
                   OptionsEndPoint="list_events"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>                   
        </Params>      
        <OutputColumns>
            <Column Name="id" Label="Id" DataType="DT_WSTR" Length="50" />
        </OutputColumns>
    </EndPoint>             

    <!--=====================================
        ============ MOVE EVENT =============
        =====================================-->  
    <EndPoint Name="move_event" 
              Label="Move event to another calendar" 
              Desc="Moves event from one calendar to another"
	            Url="/calendars/[$SourceCalendarId$]/events/[$EventId$]/move?destination=[$TargetCalendarId$]"
              Method="POST"
              DotAsPath="True"
              ContentType="application/json"
              JsonRowFormat="Multicontent"
              >    
        <Params>
            <Param Name="SourceCalendarId"
                   OptionsEndPoint="list_calendars"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>
            <Param Name="TargetCalendarId"
                   OptionsEndPoint="list_calendars"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>                   
            <Param Name="EventId"
                   OptionsEndPoint="list_events"
                   OptionsEndPointValueColumn="Id"
                   OptionsEndPointLabelColumn="Summary"
                   Required="True"/>                   
        </Params>      
        <OutputColumns>
            <Column Name="id" Label="Id" DataType="DT_WSTR" Length="50" />
        </OutputColumns>
    </EndPoint>     
  </EndPoints>



  <!--=====================================
      ============= TABLES ================
      =====================================--> 

  <Tables> 
      <Table Name="Events" 
             Desc="Insert, update, delete and list datasets"
             SelectEndPoint="list_events"
             InsertEndPoint="create_event"
             DeleteEndPoint="delete_event" 
      />
      <Table Name="Calendars"
             SelectEndPoint="list_calendars"
      />
  </Tables>    


  <!--=====================================
      ============ EXAMPLES ===============
      =====================================-->
  <Examples>
    <!-- LIST CALENDARS -->
    <Example Group="ODBC" Label="List calendars" Desc="Lists calendars">
        <Code>
            <![CDATA[SELECT * FROM Calendars]]>
        </Code>
    </Example> 

    <!-- LIST EVENTS -->
    <Example Group="ODBC" Label="List events" Desc="Lists events">
        <Code>
            <![CDATA[SELECT * FROM Events
  WITH (CalendarId='MyCalendarId')]]>
        </Code>
    </Example> 

    <!-- GET EVENT -->
    <Example Group="ODBC" Label="Get event" Desc="Gets event">
        <Code>
            <![CDATA[SELECT * FROM get_event
  WITH (CalendarId='MyCalendarId'
       ,EventId='MyEventId')]]>
        </Code>
    </Example> 

    <!-- CREATE EVENT -->
    <Example Group="ODBC" Label="Create event" Desc="Creates event">
        <Code>
            <![CDATA[INSERT INTO Events(StartsAt, StartsInTimeZone, EndsAt, EndsInTimeZone, Summary,
  Attendees, Description, Location, Status, Transparency, Visibility)
  VALUES ('2021-11-26T16:30:50', 'Europe/Vilnius', '2021-11-27T16:30:50','Europe/Vilnius', 'This is an event',
          null, 'My Description', 'Vilnius', 'confirmed', 'opaque', 'default')
  WITH (CalendarId='YourCalendarId')
        ]]>
        </Code>
    </Example> 

    <!-- DELETE EVENT -->
    <Example Group="ODBC" Label="Get event" Desc="Gets event">
        <Code>
            <![CDATA[DELETE FROM Events
    WITH (CalendarId='MyCalendarId',
    EventId='MyEventId')]]>
        </Code>
    </Example> 

    <!-- MOVE EVENT -->
    <Example Group="ODBC" Label="Move event to a different calendar" Desc="Moves event to a different calendar">
        <Code>
            <![CDATA[UPDATE move_event
  WITH (SourceCalendarId='MySourceCalendarId',
  TargetCalendarId='MyTargetCalendarId',
  EventId='MyEventId'
  )]]>
        </Code>
    </Example>
  </Examples>
</ApiConfig>