我正在使用微软图形应用程序接口,以获得所有的消息与附件。在这上面,我需要得到扩展名为docx/pdf的文件。下面是我尝试过的过滤器。
https://graph.microsoft.com/v1.0/me/messages?$filter=hasAttachments eq为true,ext eq为'docx‘
https://graph.microsoft.com/v1.0/me/messages?$filter=hasAttachments eq true和扩展eq 'docx‘
发布于 2017-07-18 04:50:03
您需要使用多个API调用来完成此操作。首先,您需要检索带有附件的messages列表(has Attachments),然后需要遍历生成的id,以便检索附件元数据。
例如,调用返回具有附件的邮件ids列表:
https://graph.microsoft.com/v1.0/me/messages?$filter=hasAttachments eq true&$select=id
对于我们得到的每个ID,然后进行第二个调用以获取附件:
https://graph.microsoft.com/v1.0/me/messages/{message id}/attachments
根据这些结果,您可以检查Attachment's name属性以确定文件扩展名是什么。
https://stackoverflow.com/questions/45137965
复制相似问题