google-api-php-client

Problem in GCP setIamPolicy API reference under PHP example

穿精又带淫゛_ 提交于 2019-12-13 03:24:18
问题 on this page https://cloud.google.com/resource-manager/reference/rest/v1/projects/setIamPolicy Way down at the bottom are come code examples. The PHP code follows. The problem is the line $response = $service->projects->setIamPolicy($resource, $requestBody); There is no defined 'projects' property. I'm guessing this is out of date. Can anyone describe how this should be used, or offer a correction? require_once __DIR__ . '/vendor/autoload.php'; $client = new Google_Client(); $client-

Google PHP SDK - not getting refresh token

爷,独闯天下 提交于 2019-12-13 02:57:13
问题 I am trying to get a refresh token for the Google API's, using the PHP SDK. I am authenticating the user with Javascript, retrieving a code, and exchanging it for an access_token server side, but this doesn't grant me an access token. What am I doing wrong? Here is the code I use: $client = new Google_Client(); $client->setClientId($client_id); $client->setClientSecret($client_secret); $client->addScope('https://www.googleapis.com/auth/plus.me'); $client->addScope('https://www.google.com/m8

Google Analytics API v3 > analytics.management.uploads.uploadData Insufficient Permission Problem

雨燕双飞 提交于 2019-12-13 02:49:39
问题 I have developed a PHP application which will send refund data to analytics. I want to send the refund via data upload. I use the Google APIs PHP client library so the following code uses the method you can find here: https://github.com/google/google-api-php-client-services/blob/a016ea7b6d47e1fd1f43d89ebd80059d4bfadb32/src/Google/Service/Analytics/Resource/ManagementUploads.php $dataTxt = "ga:transactionId;ga:quantityRefunded;ga:productSku;ga:productPrice dcn15355709483497;1;2811841;38.47

Move all threads older than X with gmail api

大憨熊 提交于 2019-12-13 02:03:23
问题 I have a folder, Archive where I'd like to store all of my emails from before a given date. In the Gmail web UI, you can accomplish this by doing a search like "in:inbox before:2012/01/01", select all, then "move" from the dropdown. I'd like to do this with the gmail api. How can I accomplish this? Will I need to do the query then iterate through each thread to move it? Or is there a better way? Bonus points for a code snippet / example or link to the relevant section of api docs. 回答1: You

Google Contacts API get phone number (PHP)

时光怂恿深爱的人放手 提交于 2019-12-12 21:28:17
问题 I'm using the Google Contacts API and I'm able to extract names and email addresses but I'd like to also get profile pictures and phone numbers. I'm using PHP and here's my code while authenticating: //if authenticated successfully... $req = new Google_HttpRequest("https://www.google.com/m8/feeds/contacts/default/full"); $val = $client->getIo()->authenticatedRequest($req); $doc = new DOMDocument; $doc->recover = true; $doc->loadXML($val->getResponseBody()); $xpath = new DOMXPath($doc); $xpath

Gmail API: How to get access token?

喜你入骨 提交于 2019-12-12 21:25:53
问题 I am testing the Gmail API. So far I have done the following: I have created the project in the Google Developers Console I have enabled the Gmail API . I have created a new Client ID and the client secret . In my PHP script I have installed the PHP Client library and followed the instructions for the setup in PHP. So now when I run the file quickstart.php it gives a link. When I open it, it appears an authorization page where I authorize my application to access the Gmail API. Then it

How do I retrieve Google Calendar Resources for my company using the PHP API client?

不想你离开。 提交于 2019-12-12 20:33:09
问题 I'm trying to use this client library: https://developers.google.com/api-client-library/php/ I see how to fetch calendars and events, but how does one fetch a company's calendar resources like meeting rooms? Just to expand a little bit, I'm looking at trying to fetch things like this: https://developers.google.com/admin-sdk/calendar-resource/#retrieving_calendar_resources In their examples, I don't see the PHP library. Is this not possible with the current client library? 回答1: The answer is I

Getting user info Google-PHP-Client issue?

梦想的初衷 提交于 2019-12-12 12:39:05
问题 First, i just want to say what information i am needing to get from the user. Full Name (First/Last) Email Address (Main Account, not @google-plus.com) Location (Country, State, city, address) Youtube Username To get all of this information, i went ahead and download/installed the PHP-Client Library located here. Since this is my first time using the API, i looked around and found the following scopes: $client->setScopes(array('https://www.googleapis.com/auth/youtube.readonly', 'https://www

Embedding Google+ Hangout App in web application

柔情痞子 提交于 2019-12-12 08:44:42
问题 Is there any way to embed a Google+ hangout app in a PHP-based website? Can I load the app inside an iframe without having to land on Google+ hangout page? If so, how? 回答1: Not really. Launching a Hangout Video Call from your own website is possible, but without special coordination with Google, it will open it in its own window/tab. See http://www.youtube.com/watch?v=Al4SbeVyLm4 for further information about how to start a Hangout Video Call from your own website. 回答2: After doing some

Impersonate the user EMAIL ID using Google Oauth2 Credentials ‘Service Account’

守給你的承諾、 提交于 2019-12-12 06:18:54
问题 I am trying to create Google calendar events using Google Api OAuth service Account from PHP GAE. I need the correct Session ID or the user EMail ID in the Calendar events field ‘created by’ . This is possible well in Google Apps Script(GAS) , it creates the events with the correct session ID. But, I want the same to be done in PHP GAE(Google App Engine) . So, I tried to impersonate the user ID as follows:Perform Google Apps Domain-Wide Delegation of Authority My aim is to insert the correct