gmail-api

How do I call the gmail api in Spring Boot 2.x using a service account?

冷暖自知 提交于 2019-12-02 08:39:54
I have a GSuite service account configured to access corporate user gmail accounts, I have provided it with all of the privileges in the G Suite Admin console including Domain Wide access. I create a service account and now want to use the credentials to send emails on their behalf. Here is my code so far: public void gmailTest(){ log.info("Gmail test"); List<String> SCOPES = new ArrayList<String>(GmailScopes.all()); // List<String> SCOPES = GmailScopes.all(); InputStream resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("Program Name-12345678.json"); try {

Deploying Gmail Apis Project Authentification probleme

柔情痞子 提交于 2019-12-02 08:10:11
when i use the app in local (on executing with visual studio) there is no probleme, but when i deploy my project the authentification doesn't work. the probleme is situated here : string path = HostingEnvironment.MapPath("~/App_Data"); FileDataStore file = new FileDataStore(path); credential =new GoogleWebAuthorizationBroker().AuthorizeAsync( new ClientSecrets { ClientId = "Client_ID", ClientSecret = "Client_Secret" }, Scopes, "me", CancellationToken.None , file ).Result; Amine Ramoul Finally I have found a solution (one of X) by my self so let begin: First we generate the authorization url

RFC822 Message-Id in new Gmail API

旧城冷巷雨未停 提交于 2019-12-02 06:40:08
We are trying to set manually the RFC822 Message-Id when sending emails using the gmail api. We have tested but seen that Gmail overrides our value. Do you know if there is a reason for this? Can we do something for this? Yes the Message-Id is always set for mail sending to be the proper format for outgoing Gmail mail, the same format as the web interface. What exactly is reason for needing to specify your own value instead of using either the message.id value returned during send for your own identifier or the final Message-Id header? 来源: https://stackoverflow.com/questions/25749488/rfc822

Access CHATS label with Gmail API

橙三吉。 提交于 2019-12-02 06:22:29
Does Gmail API provide a way to fetch Gmail chat logs? Chats is a label just like INBOX. I expected to find it in Users:label list but its not present. Is there something I have to enable to allow CHATS label to show up? Is this feature supported in Gmail API? According to Find timestamp for hangout and chat messages retrieved with gmail api , the fact that chats show up in the Gmail API at all is a bug, not a feature. They are likely leaving it out of the list of labels intentionally. From that answer, I'm inferring that accessing google hangouts history via the API is unsupported, and the

How to send structured email markup using Gmail API and Javascript?

不羁的心 提交于 2019-12-02 04:58:23
I'm trying to build a Javascript app that uses Gmail's API to send emails (to myself) including the structured data needed for Gmail's Inbox to recognise a hotel reservation. The goal is to be able to enter details about the reservation in an HTML form and have the app send me an email than Inbox then recognises as a hotel reservation and adds a Trip bundle to my inbox. I followed a worked example, here , that uses Google Apps Scripts to send emails from my account to myself. The script pulls the body from a file as html, including the necessary structured data in JSON format. This works fine,

Can't open downloaded attachments from Gmail API

两盒软妹~` 提交于 2019-12-02 04:22:21
问题 I feel like I'm missing something stupid... I'm using the PHP SDK for the new Gmail API to fetch an attachment from an email. I can get the attachment content, but unless it's a text file, I can't open the file after it's been saved. If the attachment is a PDF, it won't render. If it's an excel file, it won't open. What am I doing wrong? // this works; I get the attachment body, etc $data = $g->gmail->users_messages_attachments->get($email_account, $email_message_id, $p->getBody()-

Get direct link to gmail message via Google API

时光怂恿深爱的人放手 提交于 2019-12-02 04:16:28
Is it possible to get the link to the message using Google API? Can message id be translated somehow to direct link which can be opened in browser? SGC You can try with URL https://mail.google.com/mail/#inbox/messageId . But you should have access to this message. But this URL is generated by Gmail UI not with API. So, you have to create the above URL in your program 来源: https://stackoverflow.com/questions/29415495/get-direct-link-to-gmail-message-via-google-api

Retrive friends of friends in gmail for ios app [closed]

蹲街弑〆低调 提交于 2019-12-02 03:19:48
I want to retrieve friends of friends of gmail account in my iPhone application. I have no any idea about integration of gmail in iPhone application. Which framework I need to use or how to integrate and retrieve friends of friends ? If there is any demo or link please suggest me. go to https://developers.google.com/gmail/api/quickstart/ios and follow the steps to integrate gmail in your application. you can use this example http://code.tutsplus.com/tutorials/accessing-google-services-using-the-oauth-20-protocol--mobile-18394 i think guide for this app :-) After, you can use the api links. 来源:

Is there any way to schedule mail using gmail api?

☆樱花仙子☆ 提交于 2019-12-02 03:15:48
I am currently working gmail Queries of "GTLGmail" is there any way or query to schedule mails. I had gone through https://developers.google.com/gmail/api/guides but I am unable to find any solution for the same. Thanks in Advance. The Gmail API has no scheduling functionality. You could solve it by temporarily holding the email on your own server as Jorden mentioned in the comments, or you could look into the App Engine Cron Service . You can try Mail Scheduler ( https://github.com/siquylee/mail-scheduler ) Mail Scheduler is Gmail toolbox for sending scheduled emails and recurring emails

How to get unread mails from primary inbox in Gmail?

天大地大妈咪最大 提交于 2019-12-02 03:06:58
问题 I'm using the Javascript client API with my app and I'm trying to get unread mails from the primary inbox. If I use the INBOX and UNREAD names when requesting the labels I get all unread mails from all labels. No other label type name works, I've experimented in APIs explorer and i can't seem to figure out how to manage this. Am I missing something or is it not possible? 回答1: You can try this " in:inbox is:unread -category:(promotions OR social) " as a value for q parameter in messages.list.