google-api-php-client

Post in Google+ stream is not showing up in user's stream using google-api-PHP-client

爱⌒轻易说出口 提交于 2019-12-10 11:54:27
问题 I'm trying to post in a user's Google+ stream, and I'm trying it using the google-api PHP client. Until now, I've been able of configure a test environment using the latest google-api PHP client and an example script (See 401 Unauthorized access when posting Google+ Moments with PHP Client for more information). It looks like it posts, because it returns an array with the answer, but nothing shows up in the user stream. The answer array is: Array ( [kind] => plus#moment [type] => http:/

Google+ Sign In cross client(android/web) authentication

大城市里の小女人 提交于 2019-12-10 10:53:23
问题 i'm trying to integrate 'Log in with Google' in app that have an android and web component. Everything in the web component is working fine with the following steps: 1. Rendering the view with an anti-forgery token, client id and app name. $state = md5(rand()); Session::set('state', $state); $this->view->render('login', array( 'CLIENT_ID' => 'my_web_client_id', 'STATE' => $state, 'APPLICATION_NAME' => 'my_app_name')); 2. When user clicks on the Google's SignIn button, obtain the one-time code

Loading google api client library in codeiniter

≯℡__Kan透↙ 提交于 2019-12-10 10:46:04
问题 first I copied the Google folder to application/third_party in codeigniter framework. then google.php inside the application/libraries <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); set_include_path(APPPATH . 'third_party/' . PATH_SEPARATOR . get_include_path()); require_once APPPATH . 'third_party/Google/Client.php'; class Google extends Google_Client { function __construct($params = array()) { parent::__construct(); } } and then i have created a controller named

google-api-php-client: Invalid client secret JSON file

荒凉一梦 提交于 2019-12-10 03:45:54
问题 Seems that the latest version of the google-api-php-client for PHP doesn't line up with the docs @ https://developers.google.com/drive/web/examples/php Looking at the src code I'm seeing that it's looking for keys in the downloaded JSON that the setAuthConfigFile() method can't find: client_secret, installed, web, redirect_uris (others?) are not present in the downloaded JSON. Only private_key_id, private_key, client_email, client_id, and type are present. The code and docs seem really

Error refreshing the OAuth2 token @ Google_CalendarServices (php)

巧了我就是萌 提交于 2019-12-09 22:35:01
问题 i know there are many similar questions, where the 'invalid_grant' is the only 'answer' we got from google api, but all them are old, or discussing different ways of getting to the same message. The weird part is, that this 'thing' only stopped working for 2 days ago. In our CRM we book meetings into GoogleCalendars associated with our GoogleAccount. Now in the last 2 days we are experiencing problems, never happend before. The application fails like this: Fatal error: Uncaught exception

Resumable uploading to Google Cloud Storage using PHP API

久未见 提交于 2019-12-09 21:29:17
问题 I can successfully upload small size files to Google Cloud Storage using Google PHP API CLIENT, But cant upload a 300MB file. Return with memory error. Here is my code. $storage = new Google_Service_Storage($client); $file_name = "filenameo.zip"; $obj = new Google_Service_Storage_StorageObject(); $obj->setName($file_name); $resp = $storage->objects->insert( "bucketname", $obj, array('name' => $file_name, 'data' => file_get_contents("300mb-file.zip"), 'uploadType' => 'media') ); i tried to

How to update file in google drive v3 PHP

徘徊边缘 提交于 2019-12-09 16:37:47
问题 I cant seem to update file in google drive with the following code, everything goes fine but file remains untouched? I am working with v3 api. function updateFile($service, $fileId, $data) { try { $emptyFile = new Google_Service_Drive_DriveFile(); $file = $service->files->get($fileId); $service->files->update($fileId, $emptyFile, array( 'data' => $data, 'mimeType' => 'text/csv', 'uploadType' => 'multipart' )); } catch (Exception $e) { print "An error occurred: " . $e->getMessage(); } } 回答1: I

Downloading files using google-api-php-client

让人想犯罪 __ 提交于 2019-12-09 12:55:41
问题 I'm having an issue trying to download a file from Google Cloud Storage using the php client found at https://code.google.com/p/google-api-php-client/ I have authenticated myself ok and using the following code I can return an object which contains the link to my file $this->storageService = new Google_StorageService($this->client); $this->objects = $this->storageService->objects; $options = array( 'prefix' => 'REPORT_NAME_2013-07-01' ); $bucket_contents = $this->objects->listObjects($bucket,

Google Client Invalid JWT: Token must be a short-lived token

两盒软妹~` 提交于 2019-12-09 03:43:42
问题 I am using Google's php api client. I am running through the quickstart guide for service accounts. I followed the steps perfectly (as far as I can tell). I am running into the following error: { "error": "invalid_grant", "error_description": "Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values and use a clock with skew to account for clock differences between systems." } From what I have read the most common problem with

How to Connect to a Google Public Calendar

佐手、 提交于 2019-12-08 14:18:24
I am trying to build a script to retrieve all my events using the new Google Calendar API v3 since Google deprecated v1 and v2 on 11/17/2014. I am receiving this error: Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/calendar/v3/calendars/MY-PUBLIC-CALENDAR/events : (403) Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.' in /usr/local/lib/php/google-api-php-client/src/Google/Http/REST.php:76 Stack trace: #0 /usr/local/lib/php/google-api-php-client/src/Google/Http/REST.php(41): Google_Http_REST: