google-api

create new folder in google drive with rest api

喜你入骨 提交于 2021-01-28 02:52:36
问题 How can I create a new folder in google drive using python only if it doesn't exists? I am completely new to this google APIs and python. (I have an access token for my account and I want to create folder using that.) create folder import json import requests headers = {"Authorization": "Bearer Token"} data = { "name": "name", "mimeType": "application/vnd.google-apps.folder" } r = requests.post("https://www.googleapis.com/drive/v3/files", headers=headers,data = data) print(r.text) Only file

Avoid exposure of API key and client ID when using Google Classroom browser API

旧巷老猫 提交于 2021-01-27 20:04:11
问题 I'm trying to use the Google Classroom Browser API. I referred to the page at https://developers.google.com/classroom/quickstart/js for the Quick Start for this API, but unfortunately it seems to expose my Client ID and API key in the script within the HTML. Here's a link to the sample page provided by Google: https://github.com/gsuitedevs/browser-samples/blob/master/classroom/quickstart/index.html The Client ID and API key are exposed on lines 34 and 35: // Client ID and API key from the

express-fileupload to Google Drive API

混江龙づ霸主 提交于 2021-01-27 19:43:00
问题 I can successfully save my uploaded image in my public uploads folder and integrate google drive api but it seems that it is uploading an empty file. What should I put in the body parameter of the Google Drive API from my req.files data {name: 'country.jpg',data: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 00 48 00 00 ff ed 26 0c 50 68 6f 74 6f 73 68 6f 70 20 33 2e 30 00 38 42 49 4d 04 04 00 00 00 00 00 22 ... 246290 more bytes>,size: 246340,encoding: '7bit',tempFilePath: ''

Whats the best way to use google credentials for production app?

依然范特西╮ 提交于 2021-01-27 17:36:56
问题 I'm building a C# .net application for STT and I'm creating credentials manually. I find the documentation hugely confusing for me and I dont know how to add the credentials properly. I added a project, created a json credential and downloaded and kept on a folder and pointing to it for manually with GoogleCredential for authorization and everythings working good. But this cant be a solution for a shipped app. Current approach: GoogleCredential credentials = GoogleCredential.FromFile(Path

Google Calendar API getting 'Cannot read property 'signIn' of null'

空扰寡人 提交于 2021-01-27 14:10:28
问题 I'm trying to use Google's Calendar API to get info on specific calendar. I keep getting this error Cannot read property 'signIn' of null . I'm using the example online here https://developers.google.com/google-apps/calendar/quickstart/js. Any idea why this is happening? And can someone give me a more simple way to get calendar data? Basically I want to know which rooms in my calendar feed are free to book. Can I do this using the calendar API? const CLIENT_ID = '418414126140

Create a demo account that's usable with the Analytics Reporting API? [Google Analytics]

对着背影说爱祢 提交于 2021-01-27 13:54:56
问题 I need to test some things with a Google Analytics View, but the default demo account that Google offers does not allow user to use the Analytics Reporting API : You cannot use the demo account with the Analytics Reporting API. Attempts to do so result in a permissions error: (403) insufficientPermissions. Source I just need to replicate a view with different data already. Thanks for helping. 回答1: You cannot replicate views with data. A view will always start empty. However you can simply

Getting 'Missing required field: member' when trying to add a member to a google group via API

江枫思渺然 提交于 2021-01-27 13:54:06
问题 Trying to use Google admin directory API in order to read members of a google group (organization) - it works fine. When I try to add a member I get: { errors: [ { domain: 'global', reason: 'required', message: 'Missing required field: member' } ], code: 400, message: 'Missing required field: member' } I've googled the error and found questions like this, this and a few other unhelpful results. I checked and it's definitely not a missing scope nor permissions. #!/usr/bin/python import

module 'six.moves' has no attribute 'collections_abc'

坚强是说给别人听的谎言 提交于 2021-01-27 13:00:36
问题 I have a script that connects to YouTube API version 3 and retrieves public data. This script is deployed in airflow, it was working fine for a month, today it failed with this message for the following line: def youtube_search(term,region): youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY,cache_discovery=False) File "/usr/local/airflow/.local/lib/python3.6/site-packages/googleapiclient/discovery.py", line 455, in build_from_document if isinstance

How can I retrieve a service account OAuth2 token from Google Api with Javascript?

和自甴很熟 提交于 2021-01-27 11:45:37
问题 I need to use a google projects service account to access google API using JavaScript. In order to do this I need to OAuth2 to google API servers to get an auth token. I understand that Google provides a library (GAPI) for use on node servers, but I need a solution that will work in other secure JavaScript environments. 回答1: There are two major divisions to this task. Configuring Coding First the Configuration steps. If you don't have a google account: Navigate to google.com Find and Click

How can I retrieve a service account OAuth2 token from Google Api with Javascript?

可紊 提交于 2021-01-27 11:43:02
问题 I need to use a google projects service account to access google API using JavaScript. In order to do this I need to OAuth2 to google API servers to get an auth token. I understand that Google provides a library (GAPI) for use on node servers, but I need a solution that will work in other secure JavaScript environments. 回答1: There are two major divisions to this task. Configuring Coding First the Configuration steps. If you don't have a google account: Navigate to google.com Find and Click