Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
APIKey.cs
AclSample.cs
CalendarListSample.cs
CalendarsSample.cs
ChannelsSample.cs
ColorsSample.cs
EventsSample.cs
FreebusySample.cs
Oauth2Authentication.cs
README.md
ServiceAccount.cs
SettingsSample.cs

README.md

Calendar API

Unoffical Calendar API v3 Samples for .NET

API Description

Manipulates events and other calendar data.

Offical Documentation

Sample Description

These samples show how to access the Calendar API v3 with the Offical Google .Net client library

Tutorials to go along with some of these samples can be found on www.daimto.com

Developer Documentation

Installation

NuGet package:

Location: NuGet Google.Apis.calendar.v3 Install Command: PM> Install-Package Google.Apis.calendar.v3

PM> Install-Package Google.Apis.calendar.v3

Usage

OAuth2

var keyFileLocation = @"C:\Users\Daimto\Documents\DaimtoTestEverythingCredentials\Diamto Test Everything Project-29e50502c19b.json";
var user = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
var scopes = new String[] { Google.Apis.calendar.v3.calendarService.Scope.calendarReadonly };
var service = GoogleSamplecSharpSample.calendarv3.Auth.Oauth2Example.GetcalendarService(keyFileLocation, user, scopes);

Public API Key

var apiKey = "XXXX";
var servicePublicKey = GoogleSamplecSharpSample.calendarv3.Auth.ApiKeyExample.GetService(apiKey);

Service Account

var serviceAccountKeyFileLocation = @"C:\Users\Daimto\Documents\DaimtoTestEverythingCredentials\Diamto Test Everything Project-29e50502c19b.json";
var serviceAccountEmail = "googledrivemirrornas@daimto-tutorials-101.iam.gserviceaccount.com";
var scopes = new String[] { Google.Apis.calendar.v3.calendarService.Scope.Calendar };            
var serviceAccountService = GoogleSamplecSharpSample.calendarv3.Auth.ServiceAccountExample.AuthenticateServiceAccount(serviceAccountKeyFileLocation, serviceAccountEmail, scopes);