google-api-php-client

Youtube Analytics API PHP Invalid query. Query did not conform to the expectations

不问归期 提交于 2019-12-18 07:20:11
问题 I'm trying to make some analytics query from server to server. I'm using laravel with https://github.com/google/google-api-php-client library. This is the code I'm using: $client = new Google_Client(); $key = file_get_contents(storage_path('key.p12')); $cred = new Google_Auth_AssertionCredentials( '***@developer.gserviceaccount.com', array('https://www.googleapis.com/auth/youtube.readonly', 'https://www.googleapis.com/auth/yt-analytics.readonly'), $key); $client->setAssertionCredentials($cred

Post large video to youtube via google php client api v3

南笙酒味 提交于 2019-12-18 04:22:15
问题 I am trying to upload large videos to youtube via the latest version of the google client api (v3, latest checked out source) I have it posting the videos, but the only way I can get it to work is by reading the entire video into a string, and then passing it via the data parameter. I certainly do not want to read gigantic files into memory, but the api seems to offer no other way to do this. It seems to expect a string as the data parameter. Below is the code I'm using to post the video.

Create Simple Google Calendar Event in PHP

独自空忆成欢 提交于 2019-12-18 04:20:51
问题 I'm having a heck of a time trying to get a very simple event added to a calendar using the Google Calendar API, and I would love it if someone could point out my (probably obvious) issue. I'm using code that I found here. I've put the code in the "google-api-php-client/examples.calendar" directory, where a simple example can be found. <?php require_once '../../src/Google_Client.php'; require_once '../../src/contrib/Google_CalendarService.php'; session_start(); $client = new Google_Client();

Use OAuth Refresh Token to Obtain New Access Token - Google API

时光总嘲笑我的痴心妄想 提交于 2019-12-18 04:07:47
问题 My app is simple, it connects to the Google+ API to authenticate the user, and if successful, it retrieves the user's email and then performs a series of operations on a given database based on the email retrieved. My main issue is that every hour, my access token expires, and I seem not to know how to "refresh" it. I get the following error, which I imagine is expected: The OAuth 2.0 access token has expired, and a refresh token is not available. I am currently storing the access token on a

How to Create a Project in Google Developers Console

我是研究僧i 提交于 2019-12-17 18:52:50
问题 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

posting to google plus through api

夙愿已清 提交于 2019-12-17 17:00:17
问题 Trying to find how to post to google plus wall from PHP but got 403 even using the api explorer at got the { "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Forbidden" } ], "code": 403, "message": "Forbidden" } } My PHP code looks like: $client = new \Google_Client(); $client->setApplicationName("Speerit"); $client->setClientId($appId); $client->setClientSecret($appSecret); $client->setAccessType("offline"); // offline access $client->setIncludeGrantedScopes

Google PHP Client API: Insufficient Permission

假如想象 提交于 2019-12-17 16:49:16
问题 I have PHP code that use Google PHP Client API to use Drive service. <?php require_once 'Google/Client.php'; require_once 'Google/Service/Drive.php'; const CLIENT_ID = '[MYCLIENTID]'; const SERVICE_ACCOUNT_NAME = '[MYSERVICEACCOUNID]'; // Make sure you keep your key.p12 file in a secure location, and isn't // readable by others. const KEY_FILE = './[MYPRIVATEKEY].p12'; // Load the key in PKCS 12 format (you need to download this from the // Google API Console when the service account was

Gmail API returns 403 error code and “Delegation denied for <user email>”

人盡茶涼 提交于 2019-12-17 07:29:23
问题 Gmail API fails for one domain when retrieving messages with this error: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 OK { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Delegation denied for <user email>", "reason" : "forbidden" } ], "message" : "Delegation denied for <user email>" } I am using OAuth 2.0 and Google Apps Domain-Wide delegation of authority to access the user data. The domain has granted data access rights to the application. 回答1:

Gmail API returns 403 error code and “Delegation denied for <user email>”

倖福魔咒の 提交于 2019-12-17 07:29:01
问题 Gmail API fails for one domain when retrieving messages with this error: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 OK { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Delegation denied for <user email>", "reason" : "forbidden" } ], "message" : "Delegation denied for <user email>" } I am using OAuth 2.0 and Google Apps Domain-Wide delegation of authority to access the user data. The domain has granted data access rights to the application. 回答1:

Batch request Google Calendar php API

我怕爱的太早我们不能终老 提交于 2019-12-13 18:45:03
问题 I'm working on a google Calendar sync with my application. I'm using the latest google-api-php-client Now I want to update all my event, so i want to use the batch operation. The example code of the php client api is: $client = new Google_Client(); $plus = new Google_PlusService($client); $client->setUseBatch(true); $batch = new Google_BatchRequest(); $batch->add($plus->people->get(''), 'key1'); $batch->add($plus->people->get('me'), 'key2'); $result = $batch->execute(); So when I "translate"