google-api-php-client

Google Plus PHP api - Insert Moments not working

佐手、 提交于 2019-12-24 07:10:05
问题 I want to share my status to google plus. I followed the google api, but i am getting the unauthorized error. I am trying to fix it for more then 2 days, but i could't.. i read this answer, i download and test the api, still not working for me. 401 Unauthorized access when posting Google+ Moments with PHP Client You can check here, https://code.google.com/p/google-api-php-client/source/browse/trunk/examples/moments/simple.php In this trunk file, still they are calling the Google

Create a filter using Gmail API

守給你的承諾、 提交于 2019-12-24 06:47:16
问题 Google released recently a new version of its Gmail API which now makes possible to create filters. However the documentation is quite limited and I'm facing issues to get it working. I'm using the latest version of their PHP client. Any help would be appreciated to construct the request body. public $gmail; public function createFilter($userId) { try { $filter = new Google_Service_Gmail_Resource_UsersSettingsFilters(); // Here, we should create the request body... // https://developers

How to include Google App Engine for PHP in my scripts / autoloading?

我怕爱的太早我们不能终老 提交于 2019-12-23 16:27:28
问题 I have a website on an Ubuntu webserver (not an app and not hosted at App Engine) and I want to use google cloud storage for the upload/download of large files. I am trying to upload a file directly to the Google Cloud Storage which isn't working (maybe because I made some basic errors). I have installed the Google Cloud SDK and downloaded and unzipped Google App Engine. If I now include CloudStorageTools.php I get an the error: Class 'google\appengine\CreateUploadURLRequest' not found" My

How can I show a list of *all* available calendars using Google Calendar API v3 / Google API Client Library?

岁酱吖の 提交于 2019-12-23 16:09:33
问题 I have been trying to access the Google Calendar API v3 using PHP. Initially, I want to simply list the user calendars that are accessible to my call to the API. To do so, I have downloaded the Google API PHP Client Library and have attempted to use the following code (which is sourced, with my adaptations, from https://mytechscraps.wordpress.com/2014/05/15/accessing-google-calendar-using-the-php-api/ ): <?php //error_reporting(0); //@ini_set('display_errors', 0); // If you've used composer

Fatal error: Class 'Google_Auth_AssertionCredentials' not found

别说谁变了你拦得住时间么 提交于 2019-12-23 04:45:29
问题 I'm trying to migrate the old google api to the new one, so I can get the google analytics data. I'm trying with this example, but it fires this error Fatal error: Class 'Google_Auth_AssertionCredentials' not found in example.php This is how I'm trying: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); require_once 'google-api-php-client/vendor/autoload.php'; //$p12FilePath = '/path/to/key.p12'; $serviceClientId = '395545742105.apps.googleusercontent

HTTP 500 (Internal Server Error) when using google api php client on a remote server

时光总嘲笑我的痴心妄想 提交于 2019-12-23 03:43:17
问题 I 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: <?php require_once 'google-api-php-client/src/Google_Client.php'; require_once 'google-api-php

How to upload a file to Google Drive using Service Account in PHP?

半腔热情 提交于 2019-12-22 22:46:09
问题 Quickstart: Run a Drive App in PHP seems to be using an outdated version of [google-api-php-client][2], also it doesn't provide example on how to upload a file using Service Account. In my project I'll need to add a file (spreadsheet) using Service Account, add a spreadsheet, share the spreadsheet with another user and add rows to the spreadsheet. I'm able to get an empty list of spreadsheets, but I couldn't figure it out how to upload a file using Service Account. The PHP Class google-api

Google_Activity must be an instance of Google_ActivityObject

半腔热情 提交于 2019-12-22 13:49:07
问题 I don't know what is the error of this. I might think as well is in the library of google PHP client can someone help with this. This is my code: $this->client->refreshToken($con[0]->secret); $newtoken = $this->client->getAccessToken(); $this->client->setAccessToken($newtoken); $activityAccess = new Google_Acl(); $activityAccess->setDomainRestricted(true); $object = new Google_ActivityObject(); $originalContent = $object->setOriginalContent('Happy me'); $originalContent = $object->setContent(

Google Reseller Customer Admin User Creation Admin SDK How

可紊 提交于 2019-12-22 13:35:52
问题 Google Provisioning API is being replaced by Admin SDK. How can I create a Admin User for my Reseller Customer through Directory API programmatically after creating the customer and subscription through the Google Reseller API. Here is my work flow so far. OAuth 2 Access Token is obtained for scopes -- https://www.googleapis.com/auth/apps.order -- https://www.googleapis.com/auth/admin.directory.user Customer is created and subscription is set to flexible Now I like to create the first Admin

Google Youtube API Insert Comment always returns error response 403 - “Insufficient Permission” - domain “global”

我的梦境 提交于 2019-12-22 12:39:15
问题 I followed the docs and code samples from documentation guide i.e., here: https://developers.google.com/youtube/v3/docs/commentThreads/insert But when I execute the script it always returns a response with error code: 403 message: "Insufficient Permission" Here's complete response object: { "error": { "errors": [ { "domain": "global", "reason": "insufficientPermissions", "message": "Insufficient Permission" } ], "code": 403, "message": "Insufficient Permission" } } I spent alot of time in