google-api

How to recursivelsy read subfolders after speciying “AFolder” in parents?

白昼怎懂夜的黑 提交于 2021-01-29 10:11:47
问题 Basically, in Google Drive API, I’m trying to read a specified folder within the drive. E.g. root/Temp/TestFiles/AreInHere I want to read all files in ‘AreInHere’, and I can do this using a query specifying the id for my desired folder. E.g. ‘’’AreInHere’ in parents’ . This works fine and does as id expect, it also returns all the sub-directories in my folder but doesn’t reclusively get any files with those sub-directories? I have looked at the API reference and all the documentation for

How to get full Gmail API message when clipped?

∥☆過路亽.° 提交于 2021-01-29 09:18:02
问题 Gmail messages are clipped when body is exceeding 102kb. In the UI one can get the entire message with a link in the bottom of the page, however the Gmail API does not display it. Following the documentation, I did not manage to find any solution whatever the format chosen. The body is well printed but not entire (and no link to read the rest). Am I missing something ? 回答1: Short answer : listing messages under threads renders messages with no body limit :) The documentation does not mention

How to solve “a bytes-like object is required, not 'str'” in create_message() function?

怎甘沉沦 提交于 2021-01-29 08:34:18
问题 I'm getting an error in creating a new message using create_message(). function listed over https://developers.google.com/gmail/api/guides/drafts. def create_message(sender, to, subject, message_text): message = MIMEText(message_text) message['to'] = to message['from'] = sender message['subject'] = subject return {'raw': base64.urlsafe_b64encode(message.as_string())} Error: TypeError: a bytes-like object is required, not 'str' 回答1: base64.urlsafe_b64encode expects bytes , but the type of

Attach multiple files - Google Sheets/Gmail/Drive

▼魔方 西西 提交于 2021-01-29 08:19:27
问题 I currently have a script to create draft emails and also attach a file to them. Currently, the script does not work for multiple file attachments and also does not work if there are no attachments. Any tips on how to get (1) and (2) [below] Updated for more info: Main objective is to add a multiple file names in Col[3] and attaching the files to the draft using the files names provided in Col[3]. Example: if I type the following into Col[3]: "test.pdf, test2.pdf" it will attach the files

Google API Server-to-Server Communication not working (Ruby implementation)

混江龙づ霸主 提交于 2021-01-29 08:05:59
问题 I have followed all the steps to set up a Domain-Wide Delegation of Authority (https://developers.google.com/admin-sdk/reports/v1/guides/delegation) and followed this link too (https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) and I ended up creating this class in Ruby. class Gsuite::ServiceAccount def initialize(person: nil) end def authorized_client Google::Auth::ServiceAccountCredentials.make_creds( authorizer = Google::Auth:

Generating RSA JWT in Postman Pre-request script

纵饮孤独 提交于 2021-01-29 07:46:48
问题 I have the following pre-request script that i am using to attempt to generate a JWT for Google Api - Google uses the RS256 encryption which is where I think I am getting stuck - the CryptoJS seems to support HmacSHA256 only - Any advise would be helpful: Here's my pre-request script from Postman: function base64url(source) { // Encode in classical base64 encodedSource = CryptoJS.enc.Base64.stringify(source); // Remove padding equal characters encodedSource = encodedSource.replace(/=+$/, '');

Daily limit reached when uploading video to youtube using Youtube Data API

狂风中的少年 提交于 2021-01-29 06:23:19
问题 I'm currently trying to build a project using the youtube api. When doing tests, I had an error which says "The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>" I looked at the google cloud console and saw these: The first screenshot shows I made 38 + 13 requests so I really should have not reached the daily limit yet. Is this a bug or is it me who didn't understand how the quota limit works? 回答1: Indeed these pages you're

Google Cloud Translation API: Creating glossary error

荒凉一梦 提交于 2021-01-28 22:07:36
问题 I tried to test Cloud Translation API using glossary. So I created a sample glossary file(.csv) and uploaded it on Cloud Storage. However when I ran my test code (copying sample code from official documentation), an error occurred. It seems that there is a problem in my sample glossary file, but I cannot find it. I attached my code, error message, and screenshot of the glossary file. Could you please tell me how to fix it? And can I use the glossary so that the original language is used when

Youtube API v3 Can't reply or rate on any comment

不羁岁月 提交于 2021-01-28 21:15:42
问题 I am trying to comment and rate a comment via API but the resource is always canRate: false and canReply: false I I've tried through google javascript client and http get request, but nothing seems to be working. $http.get('https://www.googleapis.com/youtube/v3/commentThreads', { params: { key: API_KEY, part: 'snippet', textFormat: 'plainText', videoId: VIDEO_ID, order: 'relevance' } }).success(function(response) { $scope.comments = response.items; $log.debug($scope.comments); //var author =

Google API access from Windows Service

女生的网名这么多〃 提交于 2021-01-28 19:33:39
问题 I implemented Google apps API in a MVC Web app, to access for Admin SDK to add/remove users from Google apps account. In my web app, first the user needs to authenticate with the Google Apps account (OAuth 2.0), then I store the accesstoken and refreshtoken in the database storage. After that,Admin SDK API calls to add/remove user functionality in the web app uses the "offline" mode as it does not pop up the consent screen. But I need to use my database token storage(accesstokens