我可以使用Gmail API获得Gmail草稿的网址链接吗?

编程入门 行业动态 更新时间:2024-10-08 22:15:19
本文介绍了我可以使用Gmail API获得Gmail草稿的网址链接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

mail.google/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:

mail.google/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草稿的网址链接吗?

本文发布于:2023-11-02 07:08:40,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以使用   草稿   链接   网址   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!