google-api

Google Drive API How can I find the path of a file?

混江龙づ霸主 提交于 2019-12-24 12:32:35
问题 I'm trying to find the path of a file when fetching a file list with the Google Drive API. Right now, I'm able to fetch file properties (currently only fetching checksum, id, name, and mimeType): results = globalShares.service.files().list(pageSize=1000,corpora='user',fields='nextPageToken, files(md5Checksum, id, name, mimeType)').execute() items = results.get('files',[]) nextPageToken = results.get('nextPageToken',False) for file in items: print("=============================================

Google Calendar API - Can"t list events from secondary calendar

*爱你&永不变心* 提交于 2019-12-24 12:26:22
问题 I'm using the google calendar API in javascript with google-oauth-jwt. For a target user, I can list events from its default calender (after having shared it with the service account email). With a simple "get" on https://www.googleapis.com/calendar/v3/calendars/myuser@mydomain.com/events If I create a new calendar for this user directly 'by hand', I can't see any of the events from this calendar even if I shared it with the service account. Do I forget something ? Any Idea ? Thanks. 回答1:

Application using Google APIs:10

北城以北 提交于 2019-12-24 12:25:06
问题 I've opened an old project which is using Google API 10. after updating with SDK Manager to the newest update (API 14, ect.) google removed API 10 and it no longer comes with the sdk. so now when i open my Project with Eclipse it says: "Unable to resolve target 'Google Inc.:Google APIs:10'" Is there a way to: 1) Download the old Google API 10 ? 2) To make this project use the updated APIs and not to obligate me to the old Google API 10? Thanks. 回答1: I have found the answer! and it wasn't

Create Docs through the Drive API with specific page setups (margins, orientation)

夙愿已清 提交于 2019-12-24 12:16:42
问题 My app is already able to create Google Docs through the Drive API, and when doing so I can choose the title, data, and metadata. But I've been looking at the documentation and it seems there is no way to set some other properties of the Docs, such as the margins and the orientation (portrait or landscape) of the Docs being created. Is there a way to do so? After not finding an answer in the documentation, the only thing I could think of was logging in with my Google Account, going to one of

How to Skip Columns of CSV file

╄→尐↘猪︶ㄣ 提交于 2019-12-24 11:14:03
问题 I am trying to upload data from certain fields in a CSV file to an already existing table. From my understanding, the way to do this is to create a new table and then append the relevant columns of the newly created table to the corresponding columns of the main table. How exactly do I append certain columns of data from one table to another? As in, what specific commands? I am using the bigquery api and the python-client-library. 回答1: You can use pandas library for that. import pandas as pd

Cross-origin request blocked, origin 'null' no access

别等时光非礼了梦想. 提交于 2019-12-24 10:59:53
问题 I'm working on a project where I want to get my calendar events through google API, written in JS and using React. My question is why do I receive this error? I do receive my calendar events but beforehand this error pops up in the console of the web browser and I've tried it in firefox & chrome. Chrome err: https://gyazo.com/bf7687b094c24d0027bcbd4071783b8c Firefox err: https://gyazo.com/fa605bc75833d71070acbac34f1275da This is how my app.js looks like: https://gyazo.com

Google Calendar API - sendNotifications is not working

不想你离开。 提交于 2019-12-24 10:49:02
问题 I am trying to use Google Calendar API to create event and invite multiple attendees. foreach($email_invite_arr as $item){ if($item){ $attendee = new Google_Service_Calendar_EventAttendee(); $attendee->setEmail($item); $attendee_arr[]= $attendee; } } $event->setAttendees($attendee_arr); $optParams = Array( 'sendNotifications' => true, 'maxAttendees' => 10 ); $createdEvent = $service->events->insert('primary', $event, $optParams); Everything works fine. The event is getting created with all

How to use api key to access the Google Drive

社会主义新天地 提交于 2019-12-24 10:39:10
问题 I am trying to use apiGoogle Node.js client library to access the Google Drive API so I can upload some files to my drive account. My code so far: var drive = google.drive({ version: 'v3' }); drive.apiKey = "API_KEY" drive.setScope = "https://www.googleapis.com/auth/drive.file" drive.files.create({ resource: { name: 'text.text', mimeType: 'text/plain', parents:['1ATscm2nsE9KpjA66iXHB9jnMrbyik7PP'] }, media: { mimeType: 'text/plain', body: fs.createReadStream('files/text.text') } }); Errors:

“Login Required” error when trying to create live broadcast using YoutubeV3 API

左心房为你撑大大i 提交于 2019-12-24 10:12:07
问题 I am trying to create a new broadcast using google-api-ruby-client YT = Google::Apis::YoutubeV3 client = YT::YouTubeService.new client.key = 'my-api-key-here' metadata = { snippet: { title: 'test', scheduled_start_time: '2018-02-23T14:50:00.000Z' }, status: { privacy_status: 'public' } } part = 'snippet' client.insert_live_broadcast(part, metadata, {}) When I execute this code I am getting Error -# <Google::Apis::AuthorizationError: Unauthorized> [5] pry(main)> CreateYoutubeBroadcast.execute

Sign google cloud storage blob using access token

余生长醉 提交于 2019-12-24 10:04:52
问题 Goal: Generate Signed-URL Using OAuth2.0 Access Token The examples and source codes I find for signing Google Cloud Storage blobs all require service account credentials file (the private key to be specific). For instance: https://cloud.google.com/storage/docs/access-control/signing-urls-with-helpers#storage-signed-url-get-object-python However, since I follow the authorization flow discussed here, I only have OAuth2.0 access token (and I do NOT have the credentials file and private key of a