google-api-dotnet-client

Google Drive Parse error when uploading file with special unicode characters

混江龙づ霸主 提交于 2019-12-11 17:58:02
问题 A problem has occurred recently when trying to upload files with the Google API dotnet client sdk. When the file name has any special Unicode characters, it throws an error. Here is my code public static Google.Apis.Drive.v2.Data.File InsertResource(Google.Apis.Drive.v2.DriveService service, string filePath, string parentId, string fileName, string mimeType) { Google.Apis.Drive.v2.Data.File body = new Google.Apis.Drive.v2.Data.File(); try { // File's metadata. body.Title = fileName; body

How to pass state to OAuth when using the Google API Client Library for .NET?

不羁岁月 提交于 2019-12-11 13:54:33
问题 I'm using the Google OAuth API Client Library for .NET The code I'm using is based on: Oauth 2.0 The authorisation is working fine. I'd like to pass a couple of parameters into the authorisation process. It seems the state querystring is used for this process, but I can't see how to achieve this with the C# client library. 来源: https://stackoverflow.com/questions/31179334/how-to-pass-state-to-oauth-when-using-the-google-api-client-library-for-net

Google API Autentication - redirect_uri_mismatch error

自闭症网瘾萝莉.ら 提交于 2019-12-11 13:36:25
问题 I'm trying to authenticate my web app with Google Plus API. In the Google Developer console under Credentials for my Cliend Id for Web Application . I add the following redirect uri: http://localhost:50883/oauth/add_oauth_token When I run my application I get the following Error: 400. That’s an error. Error: redirect_uri_mismatch Application: SID3 You can email the developer of this application at: carlosmoralesdiego@gmail.com The redirect URI in the request: http://localhost:55404/authorize/

Authentication for Google API

流过昼夜 提交于 2019-12-11 13:14:46
问题 I'm trying to understand the flow how to authenticate user on WEB client (JS), and then use Google API on my back-end server (ASP.NET MVC application), on behalf of authenticated user for retrieving users contacts list. Here the current flow that I use: 1.In HTML I use google JS client: https://apis.google.com/js/client.js: function auth(callback) { var config = { 'client_id': '***********', 'scope': 'https://www.googleapis.com/auth/contacts.readonly' }; config.immediate = true; gapi.auth

how to get all events from google calendar using google calendar API

ぐ巨炮叔叔 提交于 2019-12-11 12:34:44
问题 With reference of this I have made a application which gets information from google calendar event using google api. I have used the same code given in above URL. Now there is one calendar with 2 calendar name like ME and XYZ. If I use my email Id then I only got the details of event with Calendar = "ME". I have used below code EventsResource.ListRequest request = service.Events.List("primary"); request.TimeMin = dtStart; request.TimeMax = dtEnd; request.ShowDeleted = false; request

Loading Google.Apis.dll gives me StackoverflowException

我的未来我决定 提交于 2019-12-11 12:09:51
问题 I'm having trouble with adding the new Google Analytics APIs to an Excel add-in that I'm building using ExcelDna. I've added these Nugets: <package id="Google.Apis" version="1.9.3" targetFramework="net45" /> <package id="Google.Apis.Analytics.v3" version="1.9.2.1160" targetFramework="net45" /> <package id="Google.Apis.Auth" version="1.9.3" targetFramework="net45" /> <package id="Google.Apis.Core" version="1.9.3" targetFramework="net45" /> If I create a class: public class Foo { public Foo() {

Google AUTH API Application Type, how important is it?

浪子不回头ぞ 提交于 2019-12-11 11:48:10
问题 I've been doing a lot tinkering around with the authentication stuff using the .NET libraries provided by Google. We have both a desktop and web-app side, and what we want to achieve is to authenticate ONCE, either on the desktop or the web side, and store the refresh token, and reuse it both on the web side and the desktop side. So the situation is like so, on the desktop side, when there's no saved existing AccessToken's and RefreshToken's, we will ask the user to authenticate via this code

Downloading file with service account using signed url in Google Cloud Storage

北战南征 提交于 2019-12-11 11:34:34
问题 My Requirement is to generate signed Url for drive uploaded document which will be shared with clients so that they can able to download files form drive without any authentication. As newbie to use drive API for first time, I am using .NET libraries to call drive API. I have setup the service account for Google API as mentioned in the document. I am able to make API call using service account and able to upload the files. I reffered to How to sign url in .net for google cloud storage to

C# Downloading a spreadsheet from Google Drive

断了今生、忘了曾经 提交于 2019-12-11 09:54:41
问题 I'm trying to download a sheet from Google Drive using the ExportLinks from FileResource API. However, the response I'm getting is not a spreadsheet but an HTML file representing the spreadsheet or something like that. Here is the request I'm using: FilesResource.GetRequest getF = new FilesResource.GetRequest(service, "1y92Rok6oYKMwvc-Oq4Uurah7y552sfmIbyD9Wzmpq54"); Google.Apis.Drive.v2.Data.File f = getF.Execute(); string downloadUrl = f.ExportLinks["application/vnd.openxmlformats

Searching file to download in google drive c#

杀马特。学长 韩版系。学妹 提交于 2019-12-11 08:46:05
问题 I am trying to create a program that will download image files in my google drive. I was able to do so, however when I am trying to search a file to return a specific file I always got an error when using the 'name' field which is base on this website https://developers.google.com/drive/v3/web/search-parameters. I don't really know the problem. This is my code GoogleHelper gh = new GoogleHelper();//calling DriveService service = GoogleHelper.AuthenticateServiceAccount(email, securityPath);