google-api-php-client

Google Api Client Php - mkdir():Permission denied

馋奶兔 提交于 2019-12-11 07:54:04
问题 Using google api client for php to fetch some data, I have encountered the following error and I can't seem to find any working solution so far. mkdir(): Permission denied $storageDir = $this->path . '/' . substr(md5($file), 0, 2); if ($forWrite && ! is_dir($storageDir)) { if (! mkdir($storageDir, 0755, true)) { throw new Google_Cache_Exception("Could not create storage directory: $storageDir"); } I checked the permissions, users and groups. Everything is fine but I can't figure what's the

Using New Google API Console project getting unauthorized_client ,Client is unauthorized to retrieve access tokens using this method

我的未来我决定 提交于 2019-12-11 07:33:14
问题 I created a Google API Console project and client ID with web application type.Then Using OAuth 2.0 Playground - Google Developers I authorized to drive, sheet and calendar scopes using my client id. Also, Service account client id and scopes added and authorized in G Suite. I tried to list files in a folder in the drive using the below sample index.php <?php require_once 'vendor/autoload.php'; require_once 'vendor/google/apiclient/examples/templates/base.php'; $service = get_service_document

Google API Data Transfer Insert: missing resource.applicationDataTransfer

六眼飞鱼酱① 提交于 2019-12-11 07:28:53
问题 I'm creating simple PHP script for transfering ownerships of drive files between users in the same domain. I want to use Admin SDK Transfers and Insert method. Google has documentation about transfers here I tried to transfer data through their webpage GUI and it went fine. What I can't do is how to make it work with PHP Client library. Let's say I have prepared object for creating requests to Transfers resource $transfers = new \Google_Service_DataTransfer($googleConnection);

Google MyBusiness access from webservers without redirects

烂漫一生 提交于 2019-12-11 06:45:36
问题 As detailed in my question to the the Google API team, I would like to work out a way to avoid redirects. In theory this should be possible as an Authentication Code from one client (JavaScript) should be agnostic of the client and thus it should work if passed to the PHP client to fetch the access and refresh tokens. Steps in theory: 1. Client gets an authorization code 2. Client exchanges the authorization code for the access and refresh tokens How am I attempting this? Run the JavaScript

RefreshToken Not getting send back after I get new token google sheets API

99封情书 提交于 2019-12-11 06:38:37
问题 I am using the google sheets API with PHP and followed the quick start guide that can be found over here https://developers.google.com/sheets/quickstart/php When I do authorize properly and store the follow json file in a speicfied path { "access_token": "xxxxxxx", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "xxxxxx", "created": 1472731452 } After this expires the following gets triggered in my code if ($client->isAccessTokenExpired()) { $client-

Bigquery API php authorization

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:51:34
问题 I'm trying to get access bigquery api using PHP library, but I always have this error: Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/bigquery/v2/projects/primeval-shadow-571/datasets/Test/tables: (401) Login Required' in ... I have a web application, that needs to get some data from table in bigquery. The Remote account is not mine, but it was created by some guy (and I don't have login and pass to log in), who gave me

Google Groups Directory API - Add user to group raises error - PHP

流过昼夜 提交于 2019-12-11 02:49:53
问题 I have been trying to add members to my google apps group. I am trying with following code but it raises error. Don't know what is doing wrong. include_once 'api-client/autoload.php'; $clientId = 'xxxxxxxxxxxxxxxxx.apps.googleusercontent.com'; $serviceAccountName = 'xxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com'; $delegatedAdmin = 'superadmin@domain.com'; $keyFile = 'mw-gxxxxxxxx.p12'; $appName = 'Example App'; $scopes = array( 'https://www.googleapis.com/auth/admin.directory.group' );

How can auto post to google plus in PHP?

假如想象 提交于 2019-12-11 01:12:46
问题 I find article about Post on Google Plus on https://developers.google.com/+/api/latest/moments/insert From that we find example shows how to create moment. $moment_body = new Google_Moment(); $moment_body->setType("http://schemas.google.com/AddActivity"); $item_scope = new Google_ItemScope(); $item_scope->setId("target-id-1"); $item_scope->setType("http://schemas.google.com/AddActivity"); $item_scope->setName("The Google+ Platform"); $item_scope->setDescription("A page that describes just how

required_once issue in Google API Client for PHP

拟墨画扇 提交于 2019-12-10 19:45:44
问题 I have been trying to import/include file in my php script file and somehow it is not working. I know this require_once question has been asked so many times [ 1. require_once with subfolders , 2. require_once() cant find the include path, 3. Using require_once for up directory not working] but none of them seemed to be working for me. Blow picture will explain what I am trying to do clearly: What I tried and errors: Attempt 1 require_once(__DIR__.'GoogleClientApi/src/Google/Service/Analytics

Error when trying to use Google OAuth 2.0 login hybrid flow (Google_IO_Exception' with message 'HTTP Error: Unable to connect: '0'')

人走茶凉 提交于 2019-12-10 19:03:06
问题 I'm trying to implement a "Sign-in using G+" button using the server-side hybrid flow and I keep getting the same error : Google_IO_Exception' with message 'HTTP Error: Unable to connect: '0' I have looked everywhere, tried everything, I can't fix it. I am using the latest version of Google PHP Client Library from GitHub (last updated on May 17th). I checked a zillion times if my client_id & client_secret were correct. Here's my code : set_include_path("C:\wamp\www\src" . PATH_SEPARATOR . get