google-api-php-client

Exclude live events from YouTube data api search query

我只是一个虾纸丫 提交于 2019-12-01 18:38:51
问题 I'm using the google-api-php-client (https://github.com/google/google-api-php-client) to search and retrieve only videos from YouTube. I know you can set a query marker called type to video like this: $searchquery = array( 'q' => "flux", 'maxResults' => 10, 'type' => 'video', 'videoDuration' => 'short', 'videoEmbeddable' => 'true' ); However it seems to also return live events/livestreams in the search results. Is there a way to exclude live event videos? They have a marker called

Sending email notifications for Events via Google Calendar API

拟墨画扇 提交于 2019-12-01 17:38:58
I'm using the calendar.events.insert API to add an Event to my Calendar via the PHP client. The event is being inserted correctly along with appropriate values as set by the API. The same however is not able to trigger an email invite to the attendees. I looked around to find that the request needs to set the param sendNotifications as true . The same doesn't seem to help either. Here is a sample code: var request = gapi.client.calendar.events.insert({ "calendarId" : calendarData.id, "sendNotifications": true, "end": { "dateTime": eventData.endTime }, "start": { "dateTime": eventData.startTime

Google sheets API v4 Create sheet and invite users

人盡茶涼 提交于 2019-12-01 17:38:31
问题 I am using a service account authentication to create a google sheet using the Google Sheets API. I want to create a spreadsheet and somehow allow my team to open it. $private_key = file_get_contents($rootDir . '/config/googleApiCredentials.p12'); $client_email = 'project-names@positive-water-134xxx.iam.gserviceaccount.com'; $scopes = implode(' ', ["https://www.googleapis.com/auth/drive"]); $credentials = new \Google_Auth_AssertionCredentials( $client_email, $scopes, $private_key ); // tried

Google Drive API get file Edit URL

眉间皱痕 提交于 2019-12-01 17:31:58
As of 04/20/2015 the Google Documents API v3.0 is deprecated, and will no longer function function on and after this date. So anyone using this API must switch to use the Google Drive API. I have integrated the Google Drive API into my PHP application, but I can not find how to get a EDIT url for a file I have created or uploaded. Previously in the Google Documents API after uploading a file, the response would return a edit url that would be a direct url to edit the file. I am using a service account that uses a generated key by my google developers account at https://console.developers

Google sheets API v4 Create sheet and invite users

一曲冷凌霜 提交于 2019-12-01 17:31:35
I am using a service account authentication to create a google sheet using the Google Sheets API. I want to create a spreadsheet and somehow allow my team to open it. $private_key = file_get_contents($rootDir . '/config/googleApiCredentials.p12'); $client_email = 'project-names@positive-water-134xxx.iam.gserviceaccount.com'; $scopes = implode(' ', ["https://www.googleapis.com/auth/drive"]); $credentials = new \Google_Auth_AssertionCredentials( $client_email, $scopes, $private_key ); // tried once with additional constructor params: // $privateKeyPassword = 'notasecret', // $assertionType =

Google Drive API get file Edit URL

萝らか妹 提交于 2019-12-01 16:23:30
问题 As of 04/20/2015 the Google Documents API v3.0 is deprecated, and will no longer function function on and after this date. So anyone using this API must switch to use the Google Drive API. I have integrated the Google Drive API into my PHP application, but I can not find how to get a EDIT url for a file I have created or uploaded. Previously in the Google Documents API after uploading a file, the response would return a edit url that would be a direct url to edit the file. I am using a

Insufficient authentication scopes error using Google API

安稳与你 提交于 2019-12-01 15:36:40
I set up Google SDK to use Google API with Application Default Credentials . For my local machine, created a credentials json file and set its path as GOOGLE_APPLICATION_CREDENTIALS as environment variable. This is worked as expected without a problem. However, when the app is deployed to Google Cloud VM, it throws the following error: [Google_Service_Exception] { "error": { "code": 403, "message": "Request had insufficient authentication scopes.", "errors": [ { "message": "Request had insufficient authentication scopes.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION

Insufficient authentication scopes error using Google API

故事扮演 提交于 2019-12-01 14:35:37
问题 I set up Google SDK to use Google API with Application Default Credentials. For my local machine, created a credentials json file and set its path as GOOGLE_APPLICATION_CREDENTIALS as environment variable. This is worked as expected without a problem. However, when the app is deployed to Google Cloud VM, it throws the following error: [Google_Service_Exception] { "error": { "code": 403, "message": "Request had insufficient authentication scopes.", "errors": [ { "message": "Request had

Google Calendar Api get events on current week

一世执手 提交于 2019-12-01 14:16:34
I'm trying to get a list of events on the current week from one public Google Calendar using the Google Api. All my configurations are good, i can do any tests, list and show events in one web page, but i searched any sort of query for get the events of the current week using the server date with out success. I think it's possible using the "q" option indicated in the Google Api documentation , but i don't know who i can indicate the current week. EDIT: I found one solution and posted as answer. Suppose I have 50 events on the week of 02-12-2017 to 02-18-2017 . The first event starts at 5am on

Google Calendar Api get events on current week

China☆狼群 提交于 2019-12-01 13:37:14
问题 I'm trying to get a list of events on the current week from one public Google Calendar using the Google Api. All my configurations are good, i can do any tests, list and show events in one web page, but i searched any sort of query for get the events of the current week using the server date with out success. I think it's possible using the "q" option indicated in the Google Api documentation, but i don't know who i can indicate the current week. EDIT: I found one solution and posted as