gmail-api

How to get full message body in Gmail?

心不动则不痛 提交于 2019-11-30 11:43:36
I want to get full message body. So I try: Message gmailMessage = service.users().messages().get("me", messageId).setFormat("full").execute(); That to get body, I try: gmailMessage.getPayload().getBody().getData() but result always null . How to get full message body? I tried this way, since message.getPayload().getBody().getParts() was always null import com.google.api.client.repackaged.org.apache.commons.codec.binary.Base64; import com.google.api.client.repackaged.org.apache.commons.codec.binary.StringUtils; (...) Message message = service.users().messages().get(user, m.getId()).execute();

Is there a way in Gmail API to include extra fields (e.g. subject, body) in the message list method?

*爱你&永不变心* 提交于 2019-11-30 11:34:33
The "Try it" part documentation allows me to play the API, and the field selector allow me to select a lot of fields, e.g. header, raw, etc. But none of them actually showed up when tried the API. The only thing I saw were still just the message ID and the thread ID. https://developers.google.com/gmail/api/v1/reference/users/messages/list E.g. The following: GET https://www.googleapis.com/gmail/v1/users/{user_id}/messages?**fields=messages(historyId%2Cid%2Cpayload%2Craw%2CsizeEstimate%2Csnippet%2CthreadId)**&key={YOUR_API_KEY} Returns: { "messages": [ { "id": "146da54fe3dc089e", "threadId":

Forward mail using gmail API

淺唱寂寞╮ 提交于 2019-11-30 09:44:37
Is there any code provided by google to forward mail. because i haven't found one. If there is any way to forward mail using GMAIL API with extra content to send with original message. Please help. I don't see any specific forward operation... You'll have to: get the message, add your extra content to the top of the original message and change the to address, then send it. Not much help to you but take note of the Threads . 来源: https://stackoverflow.com/questions/30995341/forward-mail-using-gmail-api

Gmail API domain-wide delegation

风格不统一 提交于 2019-11-30 09:40:12
问题 I am using Gmail API and I am trying to fetch emails from all users under company. But when I run code such as: function runAPI(auth) { var gmail = google.gmail('v1'); gmail.users.threads.list({auth: auth, userId: '108800016305523828361'},'',function(err, response){ if (err) { console.log("The API returned an error: " + err); return; } var threads = response.threads; console.log(threads); }) } I get error: The API returned an error: Error: Delegation denied for xxxx@xxxxx.com In admin console

Unable to search for specific coloured star (superstars) using Advanced Search in Gmail API.

£可爱£侵袭症+ 提交于 2019-11-30 07:41:17
问题 This is what we used. https://developers.google.com/gmail/api/v1/reference/users/messages/list In order to GET emails with a red star, this is what we requested. GET https://www.googleapis.com/gmail/v1/users/me/messages?q=has%3Ared-star&key={YOUR_API_KEY} The result was 0. Other criteria such as is:starred, has:attachment worked just as expected, are we doing something wrong? 回答1: You cannot use the names of the flags in the Gmail API. You have to use the following codes: has:yellow-star <=>

How can I reliably link to a Gmail conversation given a thread ID if the user is logged into multiple accounts?

你说的曾经没有我的故事 提交于 2019-11-30 07:38:16
问题 If you're logged into multiple Gmail accounts, Google changes the URLs to reference which account you're currently using. For example: https://mail.google.com/mail/u/0/#inbox/138d85da096d2126 for a convo in my primary account vs https://mail.google.com/mail/u/1/#inbox/128cfe99d055805d for a convo in another one of my accounts. Note that one account has /u/0 in the URL and the other has u/1 . My question is: given that I've used the Gmail REST API to find the ID of a particular thread, how can

How to send email through Gmail Go SDK?

夙愿已清 提交于 2019-11-30 05:26:48
I'm trying to send a new email through the gmail package . However the Message type which is required by the send method is poorly documented. Most of the fields seem used to actually parse/read emails. The only field which makes sense (at some degree) for the send method is Payload of type MessagePart though I can't figure it out how to generate the MessagePartBody as it seems to be a kind of mime type. Below is the code I have so far. func (em *Email) SendMessage(cl *Client) error { config.ClientId = cl.Username config.ClientSecret = cl.Password t := &oauth.Transport{ Config: config,

Gmail API - Parse message content (Base64 decoding?) with Javascript

断了今生、忘了曾经 提交于 2019-11-30 05:19:56
I'm trying to use the Gmail API to get a user's email, grab the message subject and body, and then display it on a webpage. I'll be doing other stuff with it, but this is the part that I am having difficulty with. I am using Angular.js. Here is my API call: function makeApiCall() { gapi.client.load('gmail', 'v1', function() { var request = gapi.client.gmail.users.messages.list({ labelIds: ['INBOX'] }); request.execute(function(resp) { var content = document.getElementById("message-list"); angular.forEach(resp, function(message) { var email = gapi.client.gmail.users.messages.get({'id': message

Is there an URL to open the Gmail compose window with a specific message ID in full-screen (pop-out)

人盡茶涼 提交于 2019-11-30 04:49:28
I use the new Gmail API to create a draft for my user. The API response provides the newly created message ID. I can then open the compose window with the URL https://mail.google.com/mail/#drafts?compose=[message-id] . However I would like to open a full-screen (popped-out) compose window. Is there an URL for that ? This URL must of course be parameterised with the message id. To be more precise, this is what I get , and this is what I want . Try this: https://mail.google.com/mail?authuser=me@gmail.com#all/{message_id} Just replace {message_id} with the actual ID string. 来源: https:/

How send Email using Gmail api in swift

六月ゝ 毕业季﹏ 提交于 2019-11-29 23:11:34
问题 The Gmail Api has no clear documentation on how to do this, I have been trying with this but there are many things that are in the air. I have sought external sources such. Source 1 and Source 2. The first seems to use the potential of the api, using the function queryForUsersMessagesSendWithUploadParameters . While the second is about a little more. Although this in Objective-C is not a problem, except for the GTMMIMEDocument object, which do not know where or if it is obtained or a library.