google-api-dotnet-client

gsutil on a Google Compute Engine VM can't use service account authentication with a key file

我怕爱的太早我们不能终老 提交于 2019-12-11 07:49:00
问题 I'm launching an instance from the google .net API and despite my best efforts I can't get it to copy anything to or from storage. Currently I'm authenticating with a developer console service account like this:- string ServiceAccountEmail = "blahblah@developer.gserviceaccount.com"; var certificate = new X509Certificate2(@"key.p12", "notasecret", X509KeyStorageFlags.Exportable); ServiceAccountCredential credential = new ServiceAccountCredential( new ServiceAccountCredential.Initializer

Google not returning more than 64 results

谁说胖子不能爱 提交于 2019-12-11 06:55:20
问题 I am using the Google API for .Net http://code.google.com/p/google-api-for-dotnet/ and no matter how many results I ask for Google never returns more than 64. Here is my code snippet: GwebSearchClient client = new GwebSearchClient("xyz"); IList<IWebResult> results = client.Search(this.SearchText.Text, 100); I expected to get 100 results, but never get more than 64 irrespective of the search term used. Any ideas? 回答1: According to the Google AJAX Search API (which uses the same HTTP requests

Unable to build project with Google APIs (.Net)

喜欢而已 提交于 2019-12-11 05:48:52
问题 I'm unable to build a project that uses the Google APIs. I followed the build instructions at https://code.google.com/p/google-api-dotnet-client/wiki/Build. I get several errors like the following: Warning 5 The primary reference "Google.Apis" could not be resolved because it has an indirect dependency on the framework assembly "System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework

Updating Calendar Event Giving Error “The specified value is not a valid quoted string”

心已入冬 提交于 2019-12-11 04:08:34
问题 As of today we are getting an error when we try to update an event using Google Calendar V3 API. Here is our code: string certificateFile = getCertificateFile(); string certificatePassword = getCertificatePassword(); string serviceAccountEmail = getServiceAccountEmail(); X509Certificate2 certificate = new X509Certificate2(AppDomain.CurrentDomain.BaseDirectory + "certs//" + certificateFile, certificatePassword, X509KeyStorageFlags.Exportable); ServiceAccountCredential credential = new

Request had insufficient authentication scopes [403] when update cell spreadsheet

瘦欲@ 提交于 2019-12-11 02:18:31
问题 In Google Developer Consol the Sheet API is enabled. I am using the same key I use to access spreadsheet.When I read data all work fine. I get a Request had insufficient authentication scopes error on the requestUp.Execute(). using System; using System.Collections.Generic; using Google.Apis.Auth.OAuth2; using Google.Apis.Sheets.v4.Data; using Google.Apis.Services; using Google.Apis.Util.Store; using Google.Apis.Sheets.v4; using System.IO; using System.Threading; namespace SpreadSheetTest {

Creating a ServiceAccountCredential for a user from a Systems account

孤街醉人 提交于 2019-12-11 02:17:31
问题 I use the following code to act on behalf of a user through a System-login (domain-wide authenticated). The only example I found which accomplishes this uses reflection to set the user. I know this isn't the proper way to accomplish this so I was wondering if someone could help me out with an example of how this should be solved ServiceAccountCredential credential = GoogleCredential.FromJson(GOOGLE_SYSTEM_USER_AUTH_INFORMATION) .CreateScoped(Scopes) .UnderlyingCredential as

Google API (Gmail) failing with failed precondition 400

北城以北 提交于 2019-12-11 02:11:27
问题 I am trying to use the google APIs to read emails and I'm repeatedly failing to get good results. It is supposed to be a server->server account that runs periodically in the background, but I can't get it to connect. The code is basic: GoogleCredential credential; using (var stream = new FileStream("Content/service_credential.json", FileMode.Open, FileAccess.Read)) { credential = GoogleCredential.FromStream(stream); credential = credential.CreateScoped(new[] { GmailService.Scope.GmailModify }

How to debug “The caller does not have permission”

元气小坏坏 提交于 2019-12-11 01:08:02
问题 I'm using Google Sheets API v4. I have tested with some sheets and my code is working but with some it's not. All I'm doing is to swap out the sheets ID. I use the code found here: https://developers.google.com/sheets/quickstart/dotnet All sheets I tested I can read and edit in my browser. The error I'm faced is: Google.Apis.Requests.RequestError\r\nThe caller does not have permission [403]\r\nErrors [\r\n\tMessage[The caller does not have permission] Location[ - ] Reason[forbidden] Domain

Google.Apis.Requests.RequestError for AdSense/Publisher related metrics

允我心安 提交于 2019-12-11 00:18:01
问题 Since yesterday, we have trouble getting data from the Analytics API for AdSense related metrics ( ga:adsensePageImpressions, ga:adsenseAdsViewed, ga:adsenseCoverage etc. ). Other metric like ga:sessions are still working. Is this some permission problem? From the main account, I can log into Analytics, and I do see current AdSense (Publisher) data. .NET, Google.Apis.Analytics.V3 1.20.0.642 (up to date), Google.Apis.AnalyticsReporting.v4 1.20.0.698. Tried with V3 and V4, same error. We are

How to create a ContactsService using Google Contact API v3 with OAuth v2 UserCredentials

梦想的初衷 提交于 2019-12-10 20:27:10
问题 My application is using Google API Calendar V3 with the OAuth and this works great. It will ask the user for their consent the first time. It is easy to use the Calendar Service to create, modify and delete calendar events. So far so good! Now I want to ask the user permission for adding and modifying contact data. By adding the following string "https://www.google.com/m8/feeds/" the user is also asked for Contact access approval. This seems to work. However, I can’t find a way to create a