gmail-api

Gmail API: Uploading inline attachments to draft message

给你一囗甜甜゛ 提交于 2019-12-12 10:15:23
问题 I'm using the Gmail API directly. I was able to send a message with attached and inline attachments using this URL: https://www.googleapis.com/gmail/v1/users/me/messages/send In the documentation, it is said that I should use the upload URI but I was not able to construct proper request for it. Anyway, now I tried the same for creating a draft message and for some reason the inline attachments are added as attached files. I'm using the same request structure as for the send: From: Date: Fri,

Disable gmail api request caching

谁都会走 提交于 2019-12-12 09:56:21
问题 I am using javascript gmail api to fetch email threads using threadId. I am using the following code: var request = gapi.client.gmail.users.threads.get({ 'userId': 'me', 'id': '123abc' }); request.execute(function(response) { var messages = response.messages; }); For the first time for a particular threadId it's working fine. And for further requests its returning the same number of messages even if the thread has more emails. But the response gives correct number of emails if I am clearing

How to send message to multiple recipients?

落爺英雄遲暮 提交于 2019-12-12 09:34:19
问题 I'm having some trouble sending a message to multiple addresses using the Gmail API. I've successfully sent a message to only one address, but get the following error when I include multiple comma-separated addresses in the 'To' field: An error occurred: https://www.googleapis.com/gmail/v1/users/me/messages/send?alt=json returned "Invalid to header"> I'm using the CreateMessage and SendMessage methods from this Gmail API guide: https://developers.google.com/gmail/api/guides/sending That guide

How to use gmail api's in chrome extension?

浪尽此生 提交于 2019-12-12 09:08:03
问题 I am new to chrome extensions and gmail api's. I am trying to connect with gmail api's while implementation of my extension. I have api keys and client id. 回答1: In your manifest you first need to add : "background": { "scripts": ["background.js" ,"client.js"] }, "content_security_policy": "script-src https://*.google.com 'unsafe-eval'; object-src 'self'", "oauth2": { "client_id": "<your client id>", "scopes": [ scope: 'https://mail.google.com/' ] }, "permissions": [ "background", "identity",

Google Gmail API - Delegation settings

◇◆丶佛笑我妖孽 提交于 2019-12-12 07:21:43
问题 Apologies if this is covered elsewhere and I have missed it. Google's Email Settings API is deprecated and set to be turned off on July 7, 2017. With this date looming, I have started investigating migrating our local delegated account management web application to the new API. As you might expect, this applications allows users to list, add and delete delegate access to a Gmail account. It currently uses the OAuth 2.0 scope of. https://apps-apis.google.com/a/feeds/emailsettings/2.0/{domain}/

400 Bad Request on Gmail API with php

为君一笑 提交于 2019-12-12 05:05:46
问题 I want my server to access a gmail account with php code. And the following is what I created with the examples I can find online. <?php session_start(); require_once dirname(dirname(__FILE__)) . '/utility/google-api-php-client/src/Google/autoload.php'; $json_file_location = 'Gmail-YQXB-7c754a18211a.json'; $client = new Google_Client(); $service = new Google_Service_Books($client); $sgmail = new Google_Service_Gmail($client); $scopes = array('https://www.googleapis.com/auth/books', 'https:/

Reply to a specific thread

孤街浪徒 提交于 2019-12-12 04:53:40
问题 I'm trying to reply to a specific thread with Gmail API. Here's my code: $strRawMessage = "From: Firstname lastname <".$userId.">\r\n"; $strRawMessage .= "To: Firstname lastname <tomail@gmail.com>\r\n"; $strRawMessage .= 'Subject: =?utf-8?B?' . base64_encode("Heres my test message") . "?=\r\n"; $strRawMessage .= "MIME-Version: 1.0\r\n"; $strRawMessage .= "Content-Type: text/html; charset=utf-8\r\n"; $strRawMessage .= 'Content-Transfer-Encoding: quoted-printable' . "\r\n\r\n"; $strRawMessage .

Gmail Draft API returning 404 error

孤街浪徒 提交于 2019-12-12 04:46:58
问题 I am trying to update a draft message with Google Apps Script. Here is the code. var forScope = GmailApp.getInboxUnreadCount(); var params = {method:"put", contentType: "application/json", headers: {"Authorization": "Bearer " + ScriptApp.getOAuthToken()}, muteHttpExceptions:true, payload:JSON.stringify({ "message": { "id": draftId, "raw": draftBody } }) }; var resp = UrlFetchApp.fetch("https://www.googleapis.com/gmail/v1/users/me/drafts/"+draftId, params); But it is returning following error

How to get email body content using Gmail API

拈花ヽ惹草 提交于 2019-12-12 04:39:48
问题 I am using Gmail API to get email data in my simple Java application and I got everything whatever I want using quickstart but I am unable to get full email content. I have used message.getRaw() but it returns null. So, anyone can help how can I access email content. 回答1: Use messages.list to obtain identifiers of the messages, which will be used later to obtain fully-qualified messages separately via messages.get . For some reason messages.list ignores fields that are set in request i.e.

How to save gmail as .eml file using gmail api and chrome extension? [closed]

半城伤御伤魂 提交于 2019-12-12 04:24:51
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I am new to gmail api and developing chrome extension which saves selected email as .eml or .msg file.I have successfully got the current/selected message id and also got the raw message data using gmail api. I want to know how I can convert the raw message data to .eml file using