google-api-php-client

Google Calendar API v3 - Not Creating Event (Server-to-Server Authentication)

风格不统一 提交于 2019-11-28 10:32:19
So after digging around for several hours, I'm at a loss for a solution. I'm attempting to create an event on my primary calendar using v3 of Google's Calendar API, but I'm not experiencing the expected behavior. I'm using server-to-server authentication in this instance. To do that I created service account credentials, moved my key pair to the same directory as my test script, and set Google Calendar API to "On" within the developer console. Below you'll find the code at issue. The expected result (as mentioned by Google) is that upon an event being successfully created/added to a calendar,

How do I access the Google Spreadsheets API in PHP?

南笙酒味 提交于 2019-11-28 09:44:08
Starting with the Google Developer documentation on the Google Spreadsheets API , I found that "A number of client libraries are provided in various languages.", but Google only provides client libraries for Java and .NET. For a PHP library, they recommend using Zend GData. So, I headed over the the Zend GData repo , and Zend says that their GData component is discontinued, and to use Google APIs Client Library for PHP . That library doesn't work with the Spreadsheets API, for that you have to go back to the original page that I started with. So, it seems like everyone's passing the buck. I

How to Create a Project in Google Developers Console

你说的曾经没有我的故事 提交于 2019-11-28 09:11:28
I am trying to create a project in Google Developers Console. Note: I am the Domain Administrator. I keep getting this error message; Error Developers Console has not been activated for your account. Your account may be suspended or disabled. If you are a Google Apps user, ask your domain administrator to enable Apphosting Admin on your account. See my steps to produce the error (screen shots): https://drive.google.com/file/d/0Bytqhoir_Tt5QmFTazM0SzZONU0/view?usp=sharing https://drive.google.com/file/d/0Bytqhoir_Tt5c3BwSnA3bThCSXc/view?usp=sharing https://drive.google.com/file/d/0Bytqhoir

Getting “Unable to parse the p12 file…” Error With google-api-php-client

非 Y 不嫁゛ 提交于 2019-11-28 07:19:13
问题 I've been searching for days and trying new and older version of google-api-php-client along with various other examples out there, but I can't seem to get around this error. The code below is the service-account example retrieved from GitHub and I dropped in my credentials and file from the API Console. I've got a different file I'm actually building, but for use in this question, I figure this simpler file would be easier to discuss. I'm getting the same error with both files. Fatal error:

Google php client library loadServiceAccountJson broken - fix enclosed

佐手、 提交于 2019-11-28 06:49:03
问题 The new function in the php library loadServiceAccountJson doesn't allow setting sub in the Google_Auth_AssertionCredentials creator, so always gives authorization fails. How do we get the library updated? The following instructions will allow a working query, in my case to the Admin SDK Directory API: First, update the php library function loadServiceAccountJson in src/Google/Client.php to this: public function loadServiceAccountJson($jsonLocation, $scopes) { $data = json_decode(file_get

google analytics custom plugin getting error invalid grant

大憨熊 提交于 2019-11-28 05:35:56
问题 $client = new Google_Client(); $client->setAuthConfigFile(plugin_dir_url( __FILE__ ) . '/client_secrets.json'); $client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob'); $client->addScope(Google_Service_Analytics::ANALYTICS_READONLY); $client->setIncludeGrantedScopes(true); $client->setAccessType('offline'); $client->revokeToken(); $auth_url = $client->createAuthUrl(); using a popup authentication with javascript and then if (!isset($_SESSION['access_token'])) { //$client->authenticate($_GET[

Trying to append a row to a Google Spreadsheet in PHP

拈花ヽ惹草 提交于 2019-11-28 04:44:52
问题 I'm using Google's Client API via Composer (https://packagist.org/packages/google/apiclient) and I have successfully authenticated and received an access token. I am trying to add a row to a Google sheet in my drive, but I can't find any relevant documentation that specifically addresses PHP. Here's what I've got so far: $service = new Google_Service_Sheets($a4e->google); // my authenticated Google client object $spreadsheetId = "11I1xNv8cHzBGE7uuZtB9fQzbgrz4z7lIaEADfta60nc"; $range = "Sheet1

Upload video to Youtube using Youtube API V3 and PHP

本秂侑毒 提交于 2019-11-28 03:24:22
I am trying to upload a video to Youtube using PHP. I am using Youtube API v3 and I am using the latest checked out source code of Google API PHP Client library. I am using the sample code given on https://code.google.com/p/google-api-php-client/ to perform the authentication. The authentication goes through fine but when I try to upload a video I get Google_ServiceException with error code 500 and message as null. I had a look at the following question asked earlier: Upload video to youtube using php client library v3 But the accepted answer doesn't describe how to specify file data to be

Using a Service Account, getAccessToken() is returning null

半世苍凉 提交于 2019-11-28 00:43:42
问题 I am running the following PHP code, using the client libraries found here: https://code.google.com/p/google-api-php-client/. I do not get any errors for any of this code, but when I call getAccessToken() , it returns null. I have allowed access to this service account on my personal calendar, and have granted full access to the project via the API Console. Any ideas? require_once 'google-api-php-client/src/Google_Client.php'; const CLIENT_ID = 'blahblahblah'; const SERVICE_ACCOUNT_NAME =

How to list Google Calendar Events without User Authentication

和自甴很熟 提交于 2019-11-28 00:30:38
On November 17, 2014 Google deprecated v1 and v2 of its Google Calendar API using the Zend Framework. It seems the only way to list publicly shared events on a publicly shared Google Calendar is through the new Google Client Library API from GitHub using OAuth 2.0 This means visitors to a public website that used to display public events now have to authenticate and login. Is that true? Is there no other way to continue to show public Google Calendar events? What you need to do is use a Service account for this. You will then be able add the service accounts email address as a user to the