使用 Outlook REST API 实现邮件文件夹对话视图的最佳方法 [英] Best way to achieve Conversation view for mail folder using Outlook REST API

查看:25
本文介绍了使用 Outlook REST API 实现邮件文件夹对话视图的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Outlook REST API 来显示邮件文件夹中的消息,并按对话对消息进行分组,就像在任何现代网络邮件中一样.

I would like to use the Outlook REST API to display the messages in a mail folder and group messages by conversations, like you have in any modern webmail.

例如对于 inbox,我会请求使用第一个查询,例如 /inbox/messages?$select=ConversationId(默认情况下它是反向的时间顺序)

For example with inbox, I would request using a first query such as <mailuri>/inbox/messages?$select=ConversationId (by default it is reverse chronological order)

仅根据 ConversationId 对请求结果进行分组是不够的,因为某些电子邮件可能不在 inbox(想想 sentmails)中或它们可能会分页,不会在第一页返回.

It is not sufficient to group this request results by ConversationId because some emails may not be in inbox (think of sentmails) or they may be paginated and not returned in the first page.

因此,对于每个不同的 ConversationId,我需要执行另一个 REST 请求,以检索参与者或简单地计算对话中的电子邮件.我可以使用新的批量请求 这样做.

Consequently, for each distinct ConversationId I need to perform another REST request, for retrieving participants or simply counting the emails in the conversation. I may use the new batch request to do this.

涉及很多请求.有没有更好的解决方案?

There are a lot of requests involved. Is there a better solution ?

推荐答案

您可能已经意识到 REST API 并没有直接提供一种将对话作为实体处理的方法.这是我们在路线图上需要改进的地方.

As you've probably realized the REST API doesn't directly provide a way to work with conversations as an entity. This is something that we have on our roadmap to improve.

根据 API 的当前状态,您所描述的基本上是正确的方法.您可以推迟第二个填写"对话的请求,直到用户选择它.

With the current state of the API what you're describing is basically the right approach. You could possibly defer the second request to "fill in" a conversation until the user selects it.

这篇关于使用 Outlook REST API 实现邮件文件夹对话视图的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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