如何在浏览器中打开使用 Gmail API 创建的草稿? [英] How to open a draft created with Gmail API in browser?
问题描述
我正在尝试使用 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.
您可以按照以下步骤重现它
- 选择任何草稿并复制其消息 ID,您可以使用 这个
- 创建一个 url 加入 https://mail.google.com/mail/u/0/#drafts/ + 你在上一步得到的消息ID.
- 在 Chrome 中打开一个新标签并将其粘贴,它会将您发送到您的草稿列表.
- 如果您将相同的网址粘贴到同一选项卡中,它将打开草稿.
- Chose any draft and copy its message id , you can use this
- Create a url joining https://mail.google.com/mail/u/0/#drafts/ + the message id you got in the last step.
- Open a new tab in Chrome and paste it, it will send you to your draft list.
- 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= 两者都没有
It does not work with https://mail.google.com/mail/u/0/#drafts/?compose= neither
当我尝试从另一个选项卡打开草稿时,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=JHrtffLJpZXxNwzKGMhcjvjBrqfPRwKWvkvJbtWpRffXldzxkNQhmkkBWJsHPbdSPdDgBVKpHKZMNtCVFgXrhwMCVjCdCRqTLJhGvqrXNKFZmJDGZ 来自哪里?
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.
所以问题是,我如何创建一个 url 来使用 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屋!