gmail-api

iOS - download attachment from Gmail using messageId and attachmentId

主宰稳场 提交于 2019-12-06 05:54:41
I am following Google Gmail API documentation in my iOS project where I need to download an attachment from a mail by using it userId, messageId and id Try out from Google . Where userId is user's Email address, id is mailId ( Try it.Enter only your EmailId ) messageId is which we get by using an one of above id which has an attachment. This is so far the code which I am have: - (void)fetchLabels { GTLQueryGmail *query = [GTLQueryGmail queryForUsersThreadsList]; [self.service executeQuery:query delegate:self didFinishSelector:@selector(displayResultWithTicket:finishedWithObject:error:)]; } -

Add custom star to Gmail Message using Gmail REST API or Google Apps Script

醉酒当歌 提交于 2019-12-06 05:54:32
问题 How can you use the Gmail REST or Apps API to add a custom star to a message? Is there an alternate label name we can use for the Gmail REST API? Is it even possible from the Google Apps Script API? Context A Gmail user can change their settings to customize which stars they want to use. These used to be called "superstars" named after the Labs feature that introduced them. It continues to appear when working them, like the asset URL: ...superstars/star_lit_green_check3.png. Gmail REST API

How to create a sub label with Gmail REST API

ぃ、小莉子 提交于 2019-12-06 05:20:23
I am using the Gmail REST API to create a label (using my own code, not a library). I have it working fine for a top level label, but now I want to create a sub label to the top label. I noticed that when I create a sub label using Gmail, then look at the list I receive via the REST API, sub labels are shown using the '/' character as a delimiter, e.g. "Top Label/Sub Label". However when I try to create a label like this, I just get a label that has the slash in the name, not an actual sub label. How can I do this? You need to make two API calls. The first to create the top level label, the

Error 400 when sending a message using python

╄→гoц情女王★ 提交于 2019-12-06 05:19:00
问题 I am trying to send an email using Gmail API. I have successfully authenticated and have a client_secret.json file on my machine. I have been able to get a list of labels using the quickstart example on the Gmail API website I have reset my scope successfully to SCOPES = 'https://mail.google.com' allowing full access to my gmail account. I have a python script, compiled from here and here. See below. When executing the script I get the following error message: An error occurred: https://www

Gmail API quota usage check

假装没事ソ 提交于 2019-12-06 04:42:58
We are developing a project working with Gmail API, it might exceed the API limit on this page https://developers.google.com/gmail/api/v1/reference/quota API Limit Daily Usage 1,000,000,000 quota units per day Per User Rate Limit 250 quota units per user per second "Exceeding a rate limit will cause an HTTP 403 or HTTP 429 Too Many Requests response and your app should respond by retrying with exponential backoff." So we can we make a call from script, to check the number of API call left before we run the project? Or it can only be seen in google API console in a web page? Does the HTTP 403

Send an HTML email using the Gmail API

喜欢而已 提交于 2019-12-06 04:39:22
For some reason the Gmail API won't send an html email. Sending plaintext works fine: var message = 'From: Me <me@gmail.com>\r\n' + 'To: Me <me@gmail.com>\r\n' + 'Subject: Hello\r\n\r\n' 'World' var raw = btoa(message) Then when I try html, it just shows up as an empty message: var message = 'From: Me <me@gmail.com>\r\n' + 'To: Me <me@gmail.com>\r\n' + 'Subject: Hello\r\n' 'Content-Type: text/html; charset=utf-8\r\n' + 'Content-Transfer-Encoding: quoted-printable\r\n\r\n' + '<html><body>' + '<h1>World</h1>' + '</body></html>' var raw = btoa(message) Any ideas? Maybe because it's not RFC 2822

Integrating gmail connection in Firebase project

≯℡__Kan透↙ 提交于 2019-12-06 04:19:15
I developped an application that uses gmail api to get all the mails from the user. Then I divided this app in a sample (almost empty) and a fragment that does everything, so I can later integrate my fragment easily in my team's project's settings. Now that my fragment is in the other project, the gmail connexion doesn't work and gives me these errors : E/Async Task: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException E/Google log in: failed I think this error is because the project uses firebase and already have a google-services.json file and mine isn't used.

Sending email from gmail api not received but shown in sent folder

老子叫甜甜 提交于 2019-12-06 04:16:07
问题 I' m using gapi to send gmail. But if I send the mail to myself, it doesn't appear in my inbox. The most strange, it appears in the 'Sent' folder. ` function sendMessage(email, callback) { // Web-safe base64 var base64EncodedEmail = btoa(email).replace(/\//g,'_').replace(/\+/g,'-'); var request = gapi.client.gmail.users.messages.send({ 'userId': 'me', 'message': { 'raw': base64EncodedEmail } }); request.execute(callback); } function send() { var var to = 'znlswd@gmail.com', subject = 'Hello

Gmail API: How to send attachments to the drafts on swift

限于喜欢 提交于 2019-12-06 03:56:05
Recently, my project add to use Gmail, so I meet many questions about it, it make me so sad. Now, I want to know how to send Images to the draft, my code as follows: func postEmailMessageRequest(model: MEMailMessageModel, request: CompletionRequest) { let uploadParameters = GTLUploadParameters() uploadParameters.data = "String".dataUsingEncoding(NSUTF8StringEncoding) uploadParameters.MIMEType = "message/rfc2822" let query = GTLQueryGmail.queryForUsersDraftsCreateWithUploadParameters(uploadParameters) as! GTLQueryProtocol! service.executeQuery(query) { (ticket : GTLServiceTicket!, messages :

In what order does threads.get() and messages.get() return a list of items?

白昼怎懂夜的黑 提交于 2019-12-05 12:45:44
It does not seem to be documented by how does threads.get() and messages.get() sort the results they return. Is the order by a descending date/time? Id just like to say that using the javascript library -- messages.list does NOT return in date ASC or date DESC. They are returned randomly as far as I can tell. At first I thought it may be my code since I was using jquery $.each to parse through the JSON but even using a native javascript for loop they are still not in Date order. It seems like the returned messages are mostly in date DESC, but every now and then one is thrown in out of order. I