Usage Samples: Add Usage Documentation for Email Attachment Download by DuncBegg · Pull Request #110 · microsoftgraph/msgraph-sdk-python
See #92 (comment)
Example:
request_message = self._msgraph_request.messages.by_message_id(message_id) request_attachment = request_message .attachments.by_attachment_id(attachment_id) query_params = AttachmentItemRequestBuilder.AttachmentItemRequestBuilderGetQueryParameters() request_config = AttachmentItemRequestBuilder.AttachmentItemRequestBuilderGetRequestConfiguration( query_parameters=query_params ) attachment = await request_attachment .get( request_configuration=request_config ) content = attachment.content_bytes content = base64.b64decode(content) content = content.decode('ascii')
How are you getting the value for "attachment_ID" in this scenario? I cannot find any way to pull any information about the attachment other than "hasattachment", which is more a property of a message than an attachment. When I use the ".attachments" property on a mailitem, say, like, "message.attachments.ID", for example, it comes up Nonetype. I know I've authenticated properly, because I am still able to pull data from the body of the email, but cannot pull the attachment.