google-api-dotnet-client

How to get my email address from credentials or authorization?

不打扰是莪最后的温柔 提交于 2019-12-25 06:09:06
问题 I am trying to use the Gmail API to send a mail on behalf of the current authenticated user. authentication: /// <summary> /// This method requests Authentcation from a user using Oauth2. /// Credentials are stored in System.Environment.SpecialFolder.Personal /// Documentation https://developers.google.com/accounts/docs/OAuth2 /// </summary> /// <param name="clientSecretJson">Path to the client secret json file from Google Developers console.</param> /// <param name="userName">Identifying

System.InvalidOperationException in MSCORLIB when Google API V3 .UploadAsync is called

最后都变了- 提交于 2019-12-25 05:06:12
问题 After resolving the problem documented in Google API V3 OAUTH2 Hang - TokenResponse-user Credentials File not created, I resumed testing my EXE deployed onto a Windows 7 PC. Again, this program works fine on my Windows 8.1 development system. The deployed version on a Windows 7 PC fails as documented below. On the Windows 7 PC, my program successfully executed GoogleWebAuthorizationBroker.AuthorizeAsync, ChannelsResource.ListRequest, VideoCategoriesResource.ListRequest , and initialization of

Google Admin Directory API SDK User Last Logged In Not Fully Accurate

半世苍凉 提交于 2019-12-25 04:45:19
问题 I use the .Net API for managing my organization's users within Google Apps. Within the directory API you can "RetrieveUser". This returns a User object that has a date property of "LastLoginTime". Google used to separate out their Last Login Time for an account into three categories using the previous api. last_login_time - the last time you directly logged into a google service using a UI last_web_mail_time - the last time you logged into gmail.com webmail last_pop_time - the last time you

When trying to use google api v3 to retrieve my list of youtube videos uploads it's not continue after the request?

£可爱£侵袭症+ 提交于 2019-12-25 03:45:10
问题 The program just hang after trying to make a request and never continue. Tried to use try and ctach but it's not throwing any exceptions or errors. This is my code in a new class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System; using System.IO; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Google.Apis.Auth.OAuth2; using Google.Apis.Services; using Google.Apis.Upload; using

Google.Apis SDK: Google+ sharing in windows phone

穿精又带淫゛_ 提交于 2019-12-25 03:14:04
问题 I have integrated Google.Apis SDK in my windows phone 8.1 store app. I have not found any API to share interactive posts on google+. Is that API is available in Google.APis SDK? If yes, Which one? For iOS GPPNativeShareBuilder is used for sharing. For Android PlusShare.Builder](https://developers.google.com/+/mobile/android/share/interactive-post) is used How to do this in Windows Phone 8.1 runtime app?. Thanks 回答1: Although a native solution does not exist for Windows, you can still build

How to continue an upload after Access Token expire?

百般思念 提交于 2019-12-24 21:18:01
问题 I have a desktop application in .net to upload files to Google Drive. The app to authorize uses a Service Account. The issue is with large files (+ 300MB). After 1 hour of upload the application raises an error with the message : Invalid Credentials The problem is that Access Token expired and I don't know how to refresh the credentials. The functions to create the DriveService are: Public Function getAuthenticator() As OAuth2Authenticator(Of AssertionFlowClient) Dim SERVICE_ACCOUNT_EMAIL As

401 (Unauthorized) Error with DotNetOpenAuth and Google Calendar

我的梦境 提交于 2019-12-24 16:25:17
问题 I've been tinkering for a while now with getting the Google Calendar API working with DotNetOpenAuth. I've tried going about it in a few different ways, and I keep running up against the following error: The remote server returned an error: (401) Unauthorized. I've tried it both by using the CalendarService in the Google Data API for .NET, and by adapting the Google Contacts sample in the DotNetOpenAuth samples project. When I tried using the CalendarService, I set up my service for

Google Calendar v3 Error “The requested minimum modification time lies too far in the past. [410]”

时光总嘲笑我的痴心妄想 提交于 2019-12-24 14:27:29
问题 We are using the Google Calendar v3 API to return a list of events for a user that have been updated since a point in time. In the v2 API there was no limitation on setting this date in the past. If we set the UpdatedMin to a date too far back (like 2 months) then the error is thrown "The requested minimum modification time lies too far in the past. [410]" If we set ShowDeleted to false then we do not get the error. I cannot find any reference to a limitation here. Does anybody know the

Rediret Uri changes automatically

血红的双手。 提交于 2019-12-24 10:40:55
问题 I am using the below code to integrate google drive with my C# example: protected void Button1_Click(object sender, EventArgs e) { UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = "********************", ClientSecret = "********************" }, new[] { DriveService.Scope.DriveFile }, "user", CancellationToken.None).Result; // Create the service. var service = new DriveService(new BaseClientService.Initializer() { HttpClientInitializer =

Google Drive API (.NET) - Transfer ownership from Service Account to Domain user

烂漫一生 提交于 2019-12-24 07:37:28
问题 I am creating file on Google drive with .NET client API with Service account. string[] scopes = new string[] { DriveService.Scope.Drive }; GoogleCredential credential; using (var stream = new FileStream(Directory.GetCurrentDirectory() + "/Resources/GoogleCredentials.json", FileMode.Open, FileAccess.Read)) { credential = GoogleCredential.FromStream(stream).CreateScoped(scopes); } DriveService drive = new DriveService(new BaseClientService.Initializer() { HttpClientInitializer = credential, });