如何获取与 SugarCRM 中的 EmailTemplate 相关的附件(注释)列表?

How to get the list of attachments (notes) related to an EmailTemplate in SugarCRM?

我正在使用 SugarCRM Enterprise,版本 8.1.0(Build 135)(Summer '18),cloud 版本,我需要从外部站点获取所有 EmailTemplates 的列表和 earch EmailTemplate 的附件(或注释)列表,通过 API.

我可以列出所有 EmailTemplates,但找不到每个模板的附件列表,我该怎么办(使用 API)?

一种方法是使用 Notes 模块上的过滤器 API 来获取每个 EmailTemplate 的附件。 到目前为止,这是我发现的唯一方法,因为在 EmailTemplates 中使用 "attachments" link 没有产生任何结果...

示例:POST 使用以下负载请求 /rest/v11_2/Notes/filter

{
    max_num: 1000,
    fields: ["id", "name"], /* specify the fields you want to receive */
    filter: [
        {"email_id": "<id of the email template goes here>"},
    ],
}

有关过滤器 API 的更多信息,请参阅 <sugar_site>/rest/v11_2/help

中的“POST /<module>/filter

备注:

  • 在旧版本的 Sugar(Sugar 8 之前)中,关系看起来不同,因此那里的过滤器应该如下所示:{filter: [{parent_type:"Emails", parent_id: "<id of the email template goes here>"}]}