【问题标题】:access reference attachment content using outlook REST API使用 Outlook REST API 访问参考附件内容
【发布时间】:2017-12-14 13:12:31
【问题描述】:

我正在使用 Outlook Rest api 扫描电子邮件并访问其所有附件。对于复制的附件,这可以正常工作。但如果附件上传到一个驱动器并作为链接发送,那么我没有找到访问其内容的方法。

使用 //attachments 端点,我得到了这个附件的以下数据:

 {'@odata.id': "....",
 '@odata.type': '#Microsoft.OutlookServices.ReferenceAttachment',
 'ContentType': 'text/plain',
 'Id': '....',
 'IsInline': True,
 'LastModifiedDateTime': '2017-12-14T13:07:47Z',
 'Name': 'ccc.txt',
 'Size': 418}

在这种情况下是否可以访问附件内容?谢谢。

【问题讨论】:

    标签: outlook-restapi


    【解决方案1】:

    您需要的属性仅在/beta 端点上可用(我猜您正在使用/v2.0?)

    SourceUrl 属性包含访问附件的 URL。

    GET /api/beta/me/messages/{message-id}/attachments
    
    {
        "Id": "AAMkADBlNmQ2MTFl...",
        "LastModifiedDateTime": "2017-12-14T16:21:02Z",
        "Name": "Document1.docx",
        "ContentType": null,
        "Size": 13955,
        "IsInline": false,
        "SourceUrl": "https://1drv.ms/w/s!AuZOv...",
        "ProviderType": "OneDriveConsumer",
        "ThumbnailUrl": "",
        "PreviewUrl": "",
        "Permission": "Other",
        "IsFolder": false
    }
    

    【讨论】:

    • 谢谢。我会检查这个
    • 谢谢。我可以获得 SourceUrl,是否有我可以使用的 API 来访问内容本身?
    • 图表可能会工作,它可以访问 OneDrive。您可以使用任何 HTTP API 对其进行 GET 操作,因为它是一个共享 URL。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多