如何在浏览器中打开使用Gmail API创建的草稿? [英] How to open a draft created with Gmail API in browser?

查看:122
本文介绍了如何在浏览器中打开使用Gmail API创建的草稿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用gmail API创建gmail草稿,并在新标签页中打开它.

当我尝试使用以下网址打开草稿时:> https://mail.google.com/mail/u/0/#drafts/草稿ID,但从外部网络无法打开草稿.相反,它列出了草稿. 如果我在Gmail标签中执行相同的操作,它将按预期工作.

When i try to open a draft using the following url : https://mail.google.com/mail/u/0/#drafts/ draft id , from a external web it does not open the draft. Instead it lists the drafts. If i do the same in a Gmail tab it works as expected.

您可以按照以下步骤进行复制

  1. 选择任何草稿并复制其消息ID,您可以使用> https://mail.google.com/mail /u/0/#drafts/ +您在上一步中获得的消息ID.
  2. 在Chrome中打开一个新标签页并将其粘贴,它将把您发送到草稿列表中.
  3. 如果将相同的网址粘贴到相同的标签中,则会打开草稿.
  1. Chose any draft and copy its message id , you can use this
  2. Create a url joining https://mail.google.com/mail/u/0/#drafts/ + the message id you got in the last step.
  3. Open a new tab in Chrome and paste it, it will send you to your draft list.
  4. If you paste the same url in the the same tab it will open the draft.

有关该问题的更多信息

它不适用于 https://mail.google .com/mail/u/0/#drafts/?compose = 都不

当我尝试从另一个标签打开草稿时,Chrome控制台抛出此错误 控制台错误

Chrome console throws this error when i try to open a draft from another tab console error

我注意到,如果你打开一个草案的URL是这样一个的 https://mail.google.com/mail/u/0/#drafts?compose=JHrtffLJpZXxNwzKGMhcjvjBrqfPRwKWvkvJbtWpRffXldzxkNQhmkkBWJsHPbdSPdDgBVKpHKZMNtCVFJXH从...

I noticed if you open a draft the url is like this one https://mail.google.com/mail/u/0/#drafts?compose=JHrtffLJpZXxNwzKGMhcjvjBrqfPRwKWvkvJbtWpRffXldzxkNQhmkkBWJsHPbdSPdDgBVKpHKZMNtCVFgXrhwMCVjCdCRqTLJhGvqrXNKFZmJDGZ , this url works also to open the draft editor from other tabs, but where does the compose value come from?

我知道这不是API错误或问题,但是如果有人遇到相同的问题,并且知道解决该问题的任何方法,我都会感激不尽.

I know it is not a API error or problem but if somebody had the same problem and know any way to solve it i will apreciate.

所以问题是,如何创建一个使用Gmail API打开gmail草稿的网址?

推荐答案

更改此url的方式,现在它的工作方式如下:

mail.google.com/mail/#inbox?compose=draft.message.id

mail.google.com/mail/#inbox?compose=draft.message.id

如果您列出了草稿,您将得到

If you list your drafts you get

{
  "drafts": [
    {
      "id": "r5632827412362757569",
      "message": {
        "id": "174f4fa0dd96af123",
        "threadId": "174f4f59344d6321"
      }
    }
  ],
  ...
}

因此,要打开此草稿,您需要以下网址:

So, to open this draft you need the following url :

mail.google.com/mail/#inbox?compose=174f4fa0dd96af123

mail.google.com/mail/#inbox?compose=174f4fa0dd96af123

这篇关于如何在浏览器中打开使用Gmail API创建的草稿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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