We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I have a problem like this:
Error Line: 83
An unhandled exception of type 'Google.Apis.Auth.OAuth2.Responses.TokenResponseException' occurred in Google.Apis.dll
Additional information: Error:"unauthorized_client", Description:"Client is unauthorized to retrieve access tokens using this method.", Uri:""
Code: ` //UserCredential credential; Dictionary<string, string> dictionary = new Dictionary<string, string>(); String serviceAccountEmail = "[email protected]";
var certificate = new X509Certificate2(@"key.p12", "notasecret", X509KeyStorageFlags.Exportable); ServiceAccountCredential credential = new ServiceAccountCredential( new ServiceAccountCredential.Initializer(serviceAccountEmail) { User = "[email protected]", AccessMethod = new BearerToken.AuthorizationHeaderAccessMethod(), DefaultExponentialBackOffPolicy = Google.Apis.Http.ExponentialBackOffPolicy.UnsuccessfulResponse503, Scopes = new[] { GmailService.Scope.MailGoogleCom } }.FromCertificate(certificate) ); // Create Gmail API service. var gmailService = new GmailService(new BaseClientService.Initializer() { HttpClientInitializer = credential, ApplicationName = "MyApp", }); // Define parameters of request. var emailListRequest = gmailService.Users.Messages.List("[email protected]"); emailListRequest.LabelIds = "INBOX"; emailListRequest.IncludeSpamTrash = true; emailListRequest.Q = "is:unread"; emailListRequest.MaxResults = 10; var emailListResponse = emailListRequest.Execute(); foreach (var item in emailListResponse.Messages) { Console.WriteLine(item.Id); } Console.Read();`
The text was updated successfully, but these errors were encountered:
It looks like you are using the .NET client library, which is supported here:
https://developers.google.com/api-client-library/dotnet/support
Sorry, something went wrong.
No branches or pull requests
Hello,
I have a problem like this:
Error Line: 83
An unhandled exception of type 'Google.Apis.Auth.OAuth2.Responses.TokenResponseException' occurred in Google.Apis.dll
Additional information: Error:"unauthorized_client", Description:"Client is unauthorized to retrieve access tokens using this method.", Uri:""
Code:
` //UserCredential credential;
Dictionary<string, string> dictionary = new Dictionary<string, string>();
String serviceAccountEmail =
"[email protected]";
The text was updated successfully, but these errors were encountered: