-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get attachment content is not implemented #92
Comments
I use that as workaround: from msgraph.generated.models.attachment_item import AttachmentItem
# attachment is of type AttachmentItem
content = attachment.additional_data['content_bytes']
content = base64.b64decode(content)
content = content.decode('ascii') |
With the last version of your SDK, my workaround does not work anymore: from msgraph.generated.models.attachment_item import AttachmentItem
# attachment is of type AttachmentItem
content = attachment.additional_data['content_bytes']
content = base64.b64decode(content)
content = content.decode('ascii')
I can not find any documentation to download mail attachments. |
Ok found how to download a message attachment: request_message = self._msgraph_request.messages.by_message_id(message_id)
request_attachment = request_message .attachments.by_attachment_id(attachment_id)
attachment = await request_attachment .get(
request_configuration=request_config
)
content = attachment.content_bytes
content = base64.b64decode(content)
content = content.decode('ascii') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
The Graph API documentation describe how to retrieve attachment content from the API:
https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http
One example: https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http#example-8-get-the-mime-raw-contents-of-an-event-attachment-on-a-message
The issue is
$value
seems not to be implemented.So it is not possible to use
$value
like described in https://learn.microsoft.com/en-us/graph/query-parameters?tabs=http#other-odata-url-capabilitiesThe text was updated successfully, but these errors were encountered: