google-api-php-client

Intermittent 403 Access Not Configured

主宰稳场 提交于 2019-12-10 18:37:24
问题 I am intermittently receiving the following error on two different API Projects. The API Projects have been functioning normally for nearly a year without change. When the error starts occurring it happens in bursts lasting several minutes, then starts functioning properly again. The error events happen several times an hour, we noticed the errors happening early last night more than 12+ hours ago. Any help is appreciated. API Scopes: www.googleapis.com/auth/userinfo.profile www.googleapis

Cannot update user information using Google PHP API Client library

◇◆丶佛笑我妖孽 提交于 2019-12-10 17:46:42
问题 I am trying to update user phone numbers on Google Apps Directory. Currently I have the API able to retrieve information on user's but when I try to set their phone numbers it just silently fails. The values do not update in the directory. It is possible I may be just missing a method that actually sends the data but I have been unable to find such a method. My current scopes are: $scopes = array('https://www.googleapis.com/auth/admin.directory.user', 'https://www.googleapis.com/auth/admin

Google Analytics API: Why is the API data different than what's being seen on the Analytics Dashboard?

对着背影说爱祢 提交于 2019-12-10 16:04:33
问题 I've been researching this for a little while now, and from what I gather, it has something to do with samplingLevel . The issue I'm gathering from most other stackoverflow questions is that unless I have a Premium Account, the data will always come back as sampled. It is worth asking, is there anyway to can alter my Google API query so the data is a little more accurate? My query code: $profiles = $analytics->management_profiles ->listManagementProfiles('myID', '~all'); foreach ($profiles-

Uncaught exception 'Google_IO_Exception' with message 'HTTP Error: Unable to connect

微笑、不失礼 提交于 2019-12-10 15:54:16
问题 I have a task (query) running some php code that retrieves data from gmail mailboxes. It has been working fine until last friday (April 10th, 2015) and now I'm getting this error log: E 11:58:26.094 2015-04-15 200 3.38 KB 14.2s /code.php 0.1.0.2 - - [15/Apr/2015:07:58:26 -0700] "POST /code.php HTTP/1.1" 200 3462 "https://xxxxxxxxx.appspot.com/start.php?email=test@email.com" "AppEngine-Google; (+http://code.google.com/appengine)" "mailroof-test.appspot.com" ms=14201 cpu_ms=407 cpm_usd=0.001221

Webmasters API User does not have sufficient permission for site

纵然是瞬间 提交于 2019-12-10 15:08:48
问题 I use google-api-php-client library to access webmaster tools data. When I wanted to list sitemaps, it appeared Fatal error: Uncaught exception 'Google_Service_Exception'(403) User does not have sufficient permission for site. See also: https://support.google.com/webmasters/answer/2451999.' I add the service account email address as a restrict user for my site, but error still exists. Finally I find the answer: A service account is not like a regular Google account. You cannot use it to

Setup push notifications for Google Calendar API using PHP client

廉价感情. 提交于 2019-12-10 14:58:35
问题 I want to setup push notifications for Google Calendar API where my server is notified whenever a particular resource on Google calendar api changes. I want to do this using the Google APIs client library for PHP . But it seems they don't have a method for watching google calendar resources in PHP library. May be other libraries have a watch method, but I'm not too sure about that. Basically to setup push notifications for a particular resource you have to send a post request to a URL like

Google Indexing API - 403 'Forbidden Response'

时间秒杀一切 提交于 2019-12-10 14:05:04
问题 I am making a call to the google indexing API for job postings: private $client; private $httpClient; public function initClient($kernel) { $this->client = new \Google_Client(); $this->client->setAuthConfig(JSON_KEY_HERE); $this->client->addScope('https://www.googleapis.com/auth/indexing'); $this->httpClient = $this->client->authorize(); } public function sendJob() { $endpoint = 'https://indexing.googleapis.com/v3/urlNotifications:publish'; $content = "{ \"url\": \"URL_HERE\", \"type\": \"URL

Revoke Google Access Token in PHP

岁酱吖の 提交于 2019-12-10 13:55:41
问题 As the title reads, I want to revoke a granted access token programatically (in PHP that is). I found this on their website, but can't seem to find a function in the api client library. Is there a clean library function? EDIT: As pointed out by DaimTo there is a function called revokeToken(). So this code works in PHP (with composer): require_once "vendor/autoload.php"; $client = new Google_Client(); $client->setApplicationName(GOOGLE_APP_NAME); $client->setClientId(GOOGLE_CLIENT_ID); $client

Resumable upload using Google Client API . Invalid Upload URL

痴心易碎 提交于 2019-12-10 12:25:56
问题 I am unable to perform resumable upload using this api please Help Me.This Code Working Fine Until i used resumable Upload . I can Upload FIle Using Multipart but not able upload big files with multipart MY Code $storageObject->setName("FIle Name.mp3"); $storageObject->setBucket($data["bucket_name"]); $mimetype = mime_content_type($data["temp_name"]); $chunkSizeBytes = 1 * 1024 * 1024; $storageClient->setDefer(true); $status = false; $filetoupload = array('name' => "FIle Name.mp3",

Google Analytics service API (ERR_CONNECTION_RESET)

帅比萌擦擦* 提交于 2019-12-10 12:00:30
问题 IMPORTANT EDIT: Found out that issue is caused by my web server (I don't know how to fix that) - tags changed. I use latest XAMPP. I am trying to set up server to server connection with Google Analytics API with OAuth following this guide: Service Applications and Google Analytics API V3: Server-to-server OAuth2 authentication? I have following code: require_once 'google-api-php-client/src/Google_Client.php'; require_once 'google-api-php-client/src/contrib/Google_AnalyticsService.php'; //