google-api-php-client

How to get email address along with people list in google plus API

戏子无情 提交于 2020-01-04 04:07:07
问题 I'm using google plus API in my web app. I could pull out all people from google plus My code is $this->client = new Google_Client(); $this->client->setApplicationName($CI->config->item('application_name', 'googleplus')); $this->client->setClientId($CI->config->item('client_id', 'googleplus')); $this->client->setClientSecret($CI->config->item('client_secret', 'googleplus')); $this->client->setRedirectUri($CI->config->item('redirect_uri', 'googleplus')); $this->client->setDeveloperKey($CI-

Error 413: Request Entity Too Large with PHP

落爺英雄遲暮 提交于 2020-01-03 02:20:32
问题 I'm using Gmail's PHP API to send emails. Using those resources, I can send messages with attachments upto 5 mb. But I can't figure out how to send attachments larger than 5 MB. I've found that it is necessary to use multipart uploadtype, but I can not figure out exactly how to implement that based on what I tried is: $service->users_messages->send($userId, $message, 'uploadType' => 'resumable']); $service->users_messages->send($userId, $message, 'uploadType' => 'multipart']); still getting

How to rename or move a file in Google Cloud Storage (PHP API)

杀马特。学长 韩版系。学妹 提交于 2020-01-03 02:04:10
问题 I am currently trying to rename and/or move a cloud storage file to another name/position, but I can't get it to work. I am using https://github.com/google/google-api-php-client as client, the uploads works fine with: ... $storageService = new \Google_Service_Storage( $client ) $file = new \Google_Service_Storage_StorageObject() $file->setName( 'test.txt' ); $storageService->objects->insert( $bucketName, $file, array( 'name' => $filename, 'data' => file_get_contents( $somefile ) ) ); ... So I

Google oauth2 access token expires in 1 hour. I want to make it 1 day

萝らか妹 提交于 2020-01-02 07:51:55
问题 I have created a project with Google OAuth2 credentials for use with Google calendar. However the access toke expires in every 1 hour. Can someone please help me change the expire time to 1 day. I have use this code to access the google calendar events: $client = new Google_Client(); $client->setApplicationName("Client_Library_Examples"); $client->setClientId($client_id); $client->setClientSecret($client_secret); $client->setRedirectUri($redirect_uri); $client->setAccessType('offline');

Google oauth2 access token expires in 1 hour. I want to make it 1 day

纵饮孤独 提交于 2020-01-02 07:51:12
问题 I have created a project with Google OAuth2 credentials for use with Google calendar. However the access toke expires in every 1 hour. Can someone please help me change the expire time to 1 day. I have use this code to access the google calendar events: $client = new Google_Client(); $client->setApplicationName("Client_Library_Examples"); $client->setClientId($client_id); $client->setClientSecret($client_secret); $client->setRedirectUri($redirect_uri); $client->setAccessType('offline');

Error refreshing the OAuth2 token { “error” : “invalid_grant” }

北城余情 提交于 2020-01-02 07:22:13
问题 please help me to understand where mistake. API Google Api PHP v3, key.p12 is the file in the .zip collection API (or where i find it ?) I masked my data with xxxxxxxxxx Excuse me for my inglish gaphp.php <?php require_once 'Google/Client.php'; require_once 'Google/Service/Analytics.php'; $client_id = 'xxx-xxx.apps.googleusercontent.com'; $service_account_name = 'xxx-xxx@developer.gserviceaccount.com'; $keyfile = 'key.p12'; $redirect_url = 'http://example.com/service/ga/gaphp.php'; $client

Google API PHP Refresh Token returns NULL

a 夏天 提交于 2020-01-02 03:23:07
问题 I'm using the Google APIs Client Library for PHP for offline authentication, but when I use this code: $this->google->refreshToken($result["google_refresh_token"])); it returns NULL. $this->google refers to an instance of the Google_Client class. Anyone an idea what this could be? If I try to change the given refresh token it returns a Google Exception Error, so it should be a valid token. Thank you! Edit: 'client_id' => 'myclientid', 'client_secret' => 'myclientsecret', 'redirect_uri' =>

Google Drive API - Fetch Shared Files Download Links

回眸只為那壹抹淺笑 提交于 2020-01-01 19:30:31
问题 I am new to Google Drive and have uploaded many files. I have changed the status of all files to be shared if the download link is known. I would like to use PHP to generate a list of all of the direct download links for the files. The PHP script is run on my localhost and I just need the array to be saved to a text file to be used later. I have had a very hard time trying to get Oauth working but came across this script that looks like what I need. I set up my service account and have my

Google Drive help required access to own Drive account

那年仲夏 提交于 2019-12-31 07:34:08
问题 I want to access my own google drive on web page but allow anyone to upload files and restrict download access or show only limited file to user for downloading. Drive API assumes that I will access another users credentials. But what I want is opposite, anyone can view my files (restricted what to view) but is free to upload. I have google nearly 6+ hours and didn't found any solution Any Help Appreciated Thanks 回答1: You say " Drive API assumes that I will access another users credentials "

Upload video to youtube using php client library v3

橙三吉。 提交于 2019-12-31 05:48:06
问题 I am trying to upload a video to youtube using client library v3. The v3 library is experimental and does not have much documentation (samples provided does not include youtube) I have properly authenticated user with oauth 2.0. And when I have access token, I am trying with this code. if ($client->getAccessToken()) { $snippet = new Google_VideoSnippet(); $snippet -> setTitle = "Demo title"; $snippet -> setDescriptio = "Demo descrition"; $snippet -> setTags = array("tag1","tag2"); $snippet ->