I'm trying to retrieve attachments in the Office365 rest api. Since I want to avoid downloading the entire attachments, I'm using a select clause to avoid downloading the content, which is in the ContentBytes property:
    $select="ContentId,ContentType,Id,IsInline,Name,Size"
So basically, I want to retrieve everything except the content. However, this gives the following error message (json):
    { 
       "error": 
          {
           "code": "RequestBroker-ParseUri",
           "message": "Could not find a property named 'ContentId' on type 'Microsoft.OutlookServices.Attachment'."
          }
    }
It's telling me that ContentId doesn't exist, which contradicts the specifications.
Edit: Here is the full request:
    GET /api/v2.0/me/messages/AAMkAGZlZjI3N2I3LTg1YWUtNDFiNC05MGI0LTVjYTVmZGI5NGI2YQBGAAAAAABzr8uDji9LRqgTCEsDv22wBwBWTXbvZW0dTKuxUGxpK4-lAAAAAAEMAABWTXbvZW0dTKuxUGxpK4-lAAC5QnKBAAA=/attachments?%24select=ContentId%2CContentType%2CId%2CIsInline%2CName%2CSize 
Even more strange, when I do the same query without specifying any select clause, it returns me a full attachment object, including a ContentId.
Anybody can help?
In case anyone has the same question for microsoft graph, you need to pass this filter:
$select=microsoft.graph.fileAttachment/contentId
like this:
GET https://graph.microsoft.com/v1.0/me/messages/attachments?$select=microsoft.graph.fileAttachment/contentId
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With