Gmail API罐装响应 [英] Gmail API Canned Responses

查看:46
本文介绍了Gmail API罐装响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用JavaScript中的Gmail API来检索Gmail中的罐头响应列表,但似乎没有API端点可以这样做.

I am trying to retrieve list of canned responses in Gmail with the help of Gmail API in javascript, but it seems there is no API end point to do so.

还有其他方法可以通过编程方式实现吗?

Is there any other way to achieve it programmatically?

推荐答案

您可以使用Gmail API检索罐装响应列表.

You can retrieve the list of canned responses using the Gmail API.

所有固定答复都存储为草稿消息",即使您删除了所有草稿消息,您仍然可以通过列出它们来检索固定答复.

All the canned responses are stored as "draft messages" even if you delete all the draft messages, you can still retrieve the canned responses by listing them.

https://developers.google.com/gmail /api/v1/reference/users/drafts/list

不幸的是,这将返回消息草稿的完整列表,包括罐装回复.为了解决这个问题,您可以:

Unfortunately, this will return the full list of the draft messages, including the canned responses. In order to address this you can either:

  • 添加一个<keyword>并使用参数q作为查询来搜索该<keyword>.例如:subject:<keyword>

  • Add a <keyword> and use the param q as query to search for this <keyword>. For example: subject:<keyword>

(不建议)删除现有的草稿消息,以便仅检索罐装响应列表.请注意,如果执行此操作,以后您将无法收到草稿消息,否则,您的脚本也会返回这些草稿.

(Not recommended) Delete the existing draft messages in order to retrieve only the list of canned responses. Note that if you do this, later on you wont be able to have draft messages, otherwise, your script will return these drafts as well.

这篇关于Gmail API罐装响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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