google-api-dotnet-client

Google Drive SDK System.Net.Http.Primitives Version 1.5.0.0 instead of 2.1.10.0

时光毁灭记忆、已成空白 提交于 2019-12-12 15:55:26
问题 Just downloaded a fresh copy of google-drive-v2-rev82-csharp-1.4.0-beta.zip and added a reference to Google.Apis.Drive.v2.dll in my VS 2012 C# project. I also added references to all the dll's in the Lib folder of the zip file. When I run the project it complains that version 2.1.10.0 of System.Net.Http.Primitives was found when it expected version 1.5.0.0. I tried adding the following to App.config but it still crashes when ran: <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm

Google Drive API v2: InsertMediaUpload - Null response received

扶醉桌前 提交于 2019-12-12 15:16:04
问题 Using: Drive v2: 1.5.0.99 Beta, .NET Framework: 4.5 The authentication takes place properly (using impersonation) - via service account (AssertionFlowClient). Access token is obtained. Service account has been granted domain wide privileges I am able to get the parent folder - ID (strRootFolder) via Service.Files.List(); byte[] byteArray = System.IO.File.ReadAllBytes(FileName); Google.Apis.Drive.v2.Data.File flUpload = new Google.Apis.Drive.v2.Data.File(); flUpload.Title = Title; flUpload

Access Google Calendar API using Service Account Authentication

ぃ、小莉子 提交于 2019-12-12 11:25:31
问题 I was able to access the Google Calendar API using the .NET Quickstart tutorial and it worked great! The problem with that tutorial is that it uses Open Authentication or OAuth2 . I will like to do the same using Service Account Authentication. (https://support.google.com/googleapi/answer/6158857?hl=en) Can someone give me an example of how I can access my calendar using a Service account key file? I have tried also tried using Google Calendar API Authentication with C# tutorial and was not

Google Calendar API v3 .NET authentication with Service Account or Web Application ID

本秂侑毒 提交于 2019-12-12 10:22:32
问题 I need to connect a Google Calendar on my .NET 4.5 application (VS 2013 project). I want to get all the information from the Calendar, such as: events, dates, notes, names, guests, etc... I used the Google Developer Console to create both a Web Application Client ID and a Service Account , but I get different errors and no results. I've implemented 2 different methods, one to login with Web Application Client ID and one to use Service Account. This is the common ASPX page public partial class

How to download YouTube report using media.download

帅比萌擦擦* 提交于 2019-12-12 02:24:42
问题 I'm looking for an example which explains how to download reports using the .Net client library for YouTube Reporting API. I have authenticated, created jobs, and retrieved a list of reports including reportUrl values. I'm unable to figure out how to use the media.download method to actually download the report and save it locally. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using System.Threading; /

Unable to retrieve settings for Google Group using .NET client library

微笑、不失礼 提交于 2019-12-12 00:45:35
问题 I'm currently writing a system which will be responsible for creating and maintaining Google Groups in such a way that they tie into (and are in sync with) our internal systems. As part of this, I am currently working on simply creating a group, changing its settings and then allocating some members to the group. So far, the first part works correctly but then the second part - using the Google Groups Settings API - fails. It seems that it is always receiving XML data when it is expecting

Using Service User to upload files to Google Drive by email address

旧时模样 提交于 2019-12-11 21:29:48
问题 I am connecting to a service account using a service account credential. I'm trying to scale this up to be used for multiple users within the same company. All users will have Google accounts managed by this company, and I will have a gsuite service account for the entire company. How can I upload a file to users personal Google Drive based on an email address using a gsuite service account? 回答1: You want to use ServiceAccountCredential , with a User property set to the appropriate user.

Update file with file id that is shared with me in Gdrive ,

て烟熏妆下的殇ゞ 提交于 2019-12-11 21:24:16
问题 C# App I need to update a file that is shared in Gdrive using File ID. Code: public static Google.Apis.Drive.v2.Data.File UpdateFile(DriveService service, String fileId, String newTitle, String newDescription, String newMimeType, String newFilename, bool newRevision) { try { // First, retrieve the file from the Google Drive. Google.Apis.Drive.v2.Data.File file = service.Files.Get(fileId).Fetch(); // Set the file's new metadata. file.Title = newTitle; // file.Description = newDescription; file

signed google.apis.dll is giving compiler error

懵懂的女人 提交于 2019-12-11 20:42:09
问题 I got the source code for the latest Google.Apis, Google.Apis.Core and Google.Apis.Auth.dll (all 1.9.x.x) and compiled them with strong name. Now when I compile my code using the strong named dlls it gives an error: The type 'Google.Apis.Services.BaseClientService.Initializer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Google.Apis, Version=1.9.0.23042, Culture=neutral, PublicKeyToken=null' in the line: UserCredential credential = new UserCredential

c# - People API does not return email address

我怕爱的太早我们不能终老 提交于 2019-12-11 18:31:30
问题 I am trying to get the email address and name of the logged-in user. I can see the name of the user but the email address shows null. Here is the code I have written to retrieve both the values: using Google.Apis.Auth.OAuth2; using Google.Apis.People.v1; using System.Net; using System.Threading; using Google.Apis.Services; using Google.Apis.People.v1.Data; UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = "jfms2vr52dm9eghchabasa5.apps