{"id":3069,"date":"2014-03-15T03:37:16","date_gmt":"2014-03-15T03:37:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/15\/google-apigoogle-api-php-clientrelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-03-15T03:37:16","modified_gmt":"2014-03-15T03:37:16","slug":"google-apigoogle-api-php-clientrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/15\/google-apigoogle-api-php-clientrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"google-api,google-api-php-clientRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2a56a798f370059d04ca815e93030fe9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2608391<br \/>\nios cocoa-touch google-api google-drive-sdk google-api-objc-client<br \/>\nI&#8217;m attempting to follow these instructions: https:\/\/developers.google.com\/drive\/quickstart-ios.Now the first time I tried this, I got the error mentioned on this question, but was able to solve it. The sample app now runs, however it crashes before uploading anything to Google Drive. It stops on the loading screen and gives the following error.Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;unexpected response data (uploading to the wrong URL?)&#8217;What does i<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1835aa139cfe99056d1b6b35c76cd24b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNumberOfGraham<br \/>\nruby-on-rails ruby http google-api<br \/>\nI&#8217;m trying to send a HTTP GET request to a Google API that requires a parameter with the name &#8220;end-date&#8221; (with a hypen, not underscore). However, the following error gets thrown:unexpected keyword_end, expecting &#8216;}&#8217;end-date: &#8216;2013-07-24&#8217;Here&#8217;s the code that I&#8217;m trying to use: request = Typhoeus::Request.new(&#8216;https:\/\/www.googleapis.com\/analytics\/v1\/reports&#8217;,method: :get,params: {end-date: &#8216;2013-07-24&#8217;,start-date: &#8216;2013-07-01&#8217;,access_token: access_token} )Any way to make params: accept the hyphena<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/93affa0e86cf19dbf2952c261b70759d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1921214<br \/>\ngoogle-api google-drive-sdk google-drive google-api-java-client<br \/>\nWe accidently deleted an already created OAuth 2.0 client id for a specific package name \/ certificate hash in an API project. When now trying to re-create this OAuth 2.0 client id for that package name \/ certificate hash we are getting the error &#8220;An unexpected error has occurred. We&#8217;re looking into it.&#8221;. Is there a way to re-activate such a deleted OAuth 2.0 client-id or to simply re-create it?&#8221;Accidently deleted&#8221; because we fall into the problem that for testing and developing we used an other<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/304727f690ee378b7b6b12428959cf43?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nShine<br \/>\nandroid google-api google-play-services<br \/>\nI&#8217;m trying to make games API work, with reference to https:\/\/github.com\/playgameservices\/android-samples\/blob\/master\/BaseGameUtils\/src\/com\/google\/example\/games\/basegameutils\/BaseGameActivity.java as sample code.Mine is quite similar, basically I&#8217;m trying to connect a game client and receive a negative answer. When trying to manage it with startResolutionForResult() this is what I got:E\/Volley(15638): [1492] il.a: Unexpected response code 403 for https:\/\/www.googleapis.com\/games\/v1\/players\/112370<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9c0a1d769e13fc851ed826e609630038?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbossylobster<br \/>\npython google-api google-calendar google-api-python-client<br \/>\nas written on the google api python client documentationDeleting a secondary calendar(under python example)service.calendars().delete(&#8216;secondaryCalendarId&#8217;).execute()this function call returns the following: method() takes exactly 1 argument (2 given)Does anyone have a clue what this error means? Clearly I just passed 1 argument and that is the calendarId that needs to be deleted. Or did anyone make this function work? Need help.Thanks.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8d21cad36bf73fedd784f9a504c14762?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPedram<br \/>\nc# .net google-analytics google-api google-api-dotnet-client<br \/>\nI&#8217;m using Google Analytics Core Reporting API. I can successfully run my request with a code like this.DataResource.GaResource.GetRequest requestData = googleAnalyticsService.Data.Ga.Get(profiles, startDateStr, endDateStr, metrics); requestData.Dimensions = dimensions; requestData.MaxResults = Globals.MAX_RESULTS;responseData = requestData.Execute();So in my responseData object I have all the data that I need. But I also need to know when I have an error in my request. So I need to catch a Googl<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d49ca28d6b846e64951858f6848432e4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWATTO Studios<br \/>\njava nullpointerexception google-api gdata-api<br \/>\nBasically I&#8217;m getting this error&#8230;java.lang.NullPointerException: Null response body com.google.gdata.util.ServiceException.setResponse(ServiceException.java:222)at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:572)at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleG<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/28f192b4b31a954245cafa04c556d0a8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1542876<br \/>\ngoogle-api go google-bigquery<br \/>\nI am trying to access data stored in Bigquery through an app I am developing on Google App Engine. However each time I make a request I receive the error &#8220;permission denied&#8221;. I have added the application as a member of the API team for the project (I added the address @appspot.gserviceaccount.com) and I am accessing bigquery through the package code.google.com\/p\/google-api-go-client\/bigquery\/v2The following code is how I append the API key to each query:transport := KeyedTransport{Key: &lt;api<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/859aa4490d07c908dfb39b91247789fd?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1157812<br \/>\nvisual-studio-2010 google-api visual-studio-addins<br \/>\nIn my Visual Studio 2010 add-in, the Exec method of the IDTCommandTarget interface stops triggering (on the relevant menu click) when I add the following line of code to the Exec method:GwebSearchClient client = new GwebSearchClient(&#8220;www.google.com&#8221;);On removing the above line, the Exec method gets called as expected. I&#8217;m using the google-api-for-dotnet and have (obviously) added the GoogleSearchAPI.dll as a reference to the add-in.If anyone can help, thanks.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ce4ac21102b2e168e6c465ebe6f65946?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHK1<br \/>\nandroid google-api google-calendar<br \/>\nI&#8217;m a new developer and I&#8217;m trying to use the Google Calender API. I followed the insturctions from http:\/\/code.google.com\/apis\/calendar\/v3\/using.html#setup and copied and pasted the example code. When I try to launch the setup method from my app it crashes with a ClassDefNotFoundException and it&#8217;s on the org.codehaus.jackson.JsonFactory class. I&#8217;ve tried almost everything. Can somebody give me an idea on what I&#8217;m doing wrong?Thanks<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/39373bc83578da71f8f5e16867b3737a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHusain Khambaty<br \/>\ngoogle-api google-api-php-client<br \/>\nNow I know this is a common topic that has been over the Internet especially StackOverflow. But what I do not have (or haven&#8217;t yet seen) is a straight solution for the token being maintained over a session.I&#8217;m using the Google APIs Client Library for PHP .My Query: I have one index.php where I fetch the user data (such as name) using the Google_Oauth2Service from the PHP client lib. The user is authenticated successfully and all goes well. Now I&#8217;d like to use the URL Shortening service and ther<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/184a07f9e8d92cea8c5c185ceb82b8f2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSunil Kumar<br \/>\nphp google-api oauth-2.0 google-oauth google-api-php-client<br \/>\nWorking on Sign in with Google. Using PHP Lib v2, Oauth 2.0. After long time spending on it finally i configured, It worked once fine but after that it is not working. On the clicking of sign in link, it will take user for authentication to Google. Working fine till then authentication done. At the time of callback with GET variables ?code=something&amp;authuser=0&amp;prompt=consent&amp;session_state=somethingIt is generating following Error:Fatal error: Uncaught exception &#8216;Google_AuthException<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1d43f4f4632e1003f2090a97ea4de9a4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmonsur<br \/>\nphp google-api google-drive-sdk google-drive google-api-php-client<br \/>\nI followed THIS TUTORIAL to upload a file on Google Drive with php, directly from a REMOTE SERVER: so I create new API Project from Google API Console, enable Drive API and Drive SDK services, request OAuth Client ID and Client Secret, and write them in a script, then upload it together with Google APIs Client Library for PHP folder to http:\/\/www.MYSERVER.com\/script1.php, to retrieve Auth code:&lt;?phprequire_once &#8216;google-api-php-client\/src\/Google_Client.php&#8217;; require_once &#8216;google-api-php-client<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6dc90e5cb12dc8f5b55a196087f1552c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nswg1cor14<br \/>\ngoogle google-api google-plus google-api-php-client<br \/>\nLot of people with similar errors&#8230;none of which answer my question. Trying to get a user to login to their Google Plus and store the refresh token so I can post on their behalf to their Moments. Cant even get past the authenticating the Token. Here&#8217;s my code:require $_SERVER[&#8216;DOCUMENT_ROOT&#8217;] . &#8216;\/members\/assets\/lib\/google\/Google_Client.php&#8217;; require $_SERVER[&#8216;DOCUMENT_ROOT&#8217;] . &#8216;\/members\/assets\/lib\/google\/contrib\/Google_PlusService.php&#8217;;$client = new Google_Client();$client-&gt;setApplicationNam<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/59c616740fb544720737c011c5845a17?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSamuele Catuzzi<br \/>\nin-app-purchase in-app-billing google-api-php-client<br \/>\napi version: google-api-php-client-0.6.7I need to verify on my server, through my php script, an android subscription purchase made by the user from my android app.So, no user interaction, the user will send to my server only the token of his purchase and my server will verify if is a valid purchase. The only way that I found that doesn&#8217;t need user interaction seem to be the &#8220;Service Accounts&#8221;, so I followed the documentation and made CLIENT_ID,SERVICE_ACCOUNT_NAME,KEY_FILE also, for testing, I<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f601e56447b7874e8016c9cb4de1ce56?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFelipe Schenone<br \/>\ngoogle-api google-drive-sdk google-api-client google-api-php-client<br \/>\nThis is what I&#8217;ve got so far, by combining this and this:require_once &#8220;google-api-php-client\/src\/Google_Client.php&#8221;; require_once &#8220;google-api-php-client\/src\/contrib\/Google_DriveService.php&#8221;; require_once &#8220;google-api-php-client\/src\/contrib\/Google_Oauth2Service.php&#8221;;\/\/First, build a Drive service object authorized with the service accounts $auth = new Google_AssertionCredentials(DRIVE_SERVICE_ACCOUNT_EMAIL,array( DRIVE_SCOPE ),file_get_contents( DRIVE_SERVICE_ACCOUNT_KEY ) ); $client = new Google_<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/dzY53.jpg?s=32&amp;g=1\" \/><br \/>\nAsius Ice Sword<br \/>\ngoogle-api-php-client oauth2-playground<br \/>\nI&#8217;m using the Google API v3 to PHP and &#8220;OAuth 2.0 Playground&#8221;, but do not know how to integrate the data that I provide &#8220;Playground&#8221; in my PHP code.This is my code:$client = new Google_Client(); $client-&gt;setApplicationName(&#8220;pruebas-web&#8221;);$client-&gt;setClientId(&#8216;&lt;MY-CLIENT-ID&#8211;FROM GOOLE API CONSOLE&gt;&#8217;); $client-&gt;setClientSecret(&#8216;&lt;MY-CLIENT-SECRET&#8211;FROM GOOLE API CONSOLE&gt;&#8217;); $client-&gt;setRedirectUri(&#8216;https:\/\/LOCAL.MYWEB.COM\/simple.php&#8217;); $client-&gt;setDeveloperKey(&#8216;&lt;GOOGLE<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d663ef0a467183e1e5362692a00184ed?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2864030<br \/>\nyoutube-api google-api google-oauth google-api-php-client youtube-analytics<br \/>\nI am trying to get some YouTube Analytics reports using the API with a Service account in order to perform some CRON jobs. I&#8217;ve already solved the common problem of NTP server sync and, obviously, i&#8217;ve set up the API console properly. &lt;?phpini_set(&#8216;display_errors&#8217;, 1);require_once &#8216;gapi\/src\/Google_Client.php&#8217;; require_once &#8216;gapi\/src\/contrib\/Google_YouTubeAnalyticsService.php&#8217;;\/\/ Define constants. const CLIENT_ID = &#8216;************************.apps.googleusercontent.com&#8217;; const SERVICE_ACCOUNT_NA<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/76648bbda401c75f7c3c48712be20b0d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEli A Taylor<br \/>\nyoutube-api google-api oauth-2.0 google-api-php-client<br \/>\nOur project lets users upload videos to OUR public youtube channel when they are signed into our session. We do not want to require additional OAuth2 verification, and instead follow the follow of Google API v2. My code (php) and error are below, but my general question is: can my server make the insert-video POST using my API key\/secrets without requiring the user to authenticate.This question &#8211; Google Calendar API v3 hardcoded credentials &#8211; is very similar. Howevr if CURLing Google for the acc<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>user2608391 ios cocoa-touch google-api google-drive-sdk google-api-objc-client I&#8217;m attempting to follow these instructions: https:\/\/developers.google.com\/drive\/quickstart-ios.Now the first time I tried this, I got the error mentioned on this question, but was able to solve it. The sample app now runs, however it crashes before uploading anything to Google Drive. It stops on the loading screen and gives [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3069","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3069"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3069\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}