google drive sdk - Google_Http_REST::decodeHttpResponse throws exception unexpectedly -
We are using PHP client: "google / apiclient": "1.0.4-beta" / strong> Our script was previously working to upload a CSV to our Google Drive, but stop working now. We have not changed anything We tried God, Scaffolding, Production Google Product ID, throwing all the same error Is there any problem on the API side? Or is there a problem on our script? Exception: Our code: $ client = new \ Google_Client (); It was a temporary problem and it is now fixed.
# 0 / home / dev / workspace / FB / vendor / google / apiclient / src / Google / Http /REST.php (44): Google_Http_REST :: decodeHttpResponse (object (Google_Http_Request)) # 1 /home/dev/workspace/fb/vendor/google/apiclient/src/Google/Client.php(499): Google_Http_REST :: execute (Object (Google_Client), Object (Google_Http_Request )) # 2 /home/dev/workspace/fb/vendor/google/apiclient/src/Google/Service/Resource.php(195): Google_Client- & gt; Execute (Object (Google_Http_Request)) # 3 /home/dev/workspace/fb/vendor/google/apiclient/src/Google/Service/Drive.php(1694): Google_Service_Resource- & gt; Call ('insert', array, 'Google_Service _...') # 4 /home/dev/workspace/fb/app/modules/Core/Models/Report/Generator/Spreadsheet/Google.php(53): Google_Service_Drive_Files_Resource- & Gt; Enter (Object (Google_Service_Drive_DriveFile, Array) # 5 / home /dev/workspace/fb/app/modules/Core/Models/Report/Manager.php(69): Core \ Model \ Report \ Generator \ Spreadsheet \ Google- & Gt; Insert ('Report_21_test_...', array) # 6 /home/dev/workspace/fb/app/modules/Core/Commands/Report/GenerateByQuery.php(55): ......
$ client-> Set client id ($ apiConfig ['clientId']); $ Client- & gt; Set Disclaimer Credentials (new \ Google_Auth_AssertionCredentials ($ apiConfig ['accountName'], array ('https://www.googleapis.com/auth/drive', $ key)); $ This- & gt; Service = new \ Google_Service_Drive ($ client); $ Date = Date ("Y-M-DHH: I: S"); // Slice $ data for maximum rows = array_slice ($ data, 0, self :: MAX_ROWS); // Generate spreadsheet with file name and data $ file = new \ Google_Service_Drive_DriveFile (); $ File & gt; SetTitle ("$ filename"); $ File- & gt; Set descriptio ("Reports generated in $ date"); $ File & gt; setMimeType (auto :: MIME_TYPE_ORIGINAL); $ CsvStr = $ this- & gt; GetCsv string ($ data); $ Created file = $ this- & gt; Service-> File-> Enter ($ file, array ('data' = & gt; $ csvStr, 'mimeType' = & gt; self: MIME_TYPE_GOOGLE, 'upload type' = & gt; multipartile ',' convert '= & gt; true, )); // Exceptions from here // Set allow $ this-> Service-> Permissions - & gt; Insert ($ created File-> Mill ID), $ this- & gt; GetPermission ());
Comments
Post a Comment