我可以使用Gmail API获得Gmail草稿的网址链接吗? [英] Can I get a URL link to a Gmail draft using the Gmail API?

查看:176
本文介绍了我可以使用Gmail API获得Gmail草稿的网址链接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的Gmail API允许我们创建和查看草稿,但是有没有办法获得URL链接以查看草稿?



我可以使用草稿的ThreadId手动创建链接,如下所示:

https://mail.google.com/mail/u/0/#drafts?compose= {的ThreadId }



但是,如果Google决定改变这些网址的结构,那就略显脆弱。我也不知道其他国家的人的URL是否会有所不同。取决于您在浏览器中登录的帐户数量,0也会发生变化。有没有更好的方式来获得这个链接,而不是像我这样手动创建它?

另外,有没有一种方法可以将认证信息与URL一起传递,以便用户登录到网页时?我假设没有办法做到这一点,但我想检查。如果用户没有登录,草稿链接会弹出登录页面,登录后不会显示草稿。

解决方案

否,手动创建网址是当前您的最佳选择。如果需要,您可以放弃 u / 0 / ,Gmail会自动使用第一个经过身份验证的帐户。

否,您无法自动为Gmail用户签名。


The new Gmail API allows us to create and view drafts, but is there a way to get a URL link to view the draft?

I can manually create the link using the draft's ThreadId with something like this:

https://mail.google.com/mail/u/0/#drafts?compose={ThreadId}

But that is somewhat fragile if Google decides to change how those URLs are structured. I also don't know if the URL will be different for people in other countries. The 0 will also change depending on how many accounts you are logged into in the browser. Is there a better way to get this link than creating it manually like I am?

Also, is there a way to pass authentication information along with the URL so that user is logged in when going to the webpage? I'm assuming that there is no way to do this, but I wanted to check. If a user is not logged in, the draft link brings up the login page and the draft is not displayed after logging in.

解决方案

No, creating the URL manually is currently your best option. You can drop the u/0/ if you want and Gmail will automatically use the first authenticated account.

No, there is not a way for you to automatically sign a user into Gmail.

这篇关于我可以使用Gmail API获得Gmail草稿的网址链接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆