Skip to content

[Question] how do i pull the attachment name? #334

@lia-cha-avalara

Description

@lia-cha-avalara

I have something like this:

protocol = MSGraphProtocol(api_version='beta')
account = Account(credentials, protocol=protocol, auth_flow_type='credentials', tenant_id=tenant_id)
mailbox = account.mailbox(resource='john.doe@mail.com')
inbox = mailbox.inbox_folder()
messages = inbox.get_messages(limit=50, download_attachments=True)
for message in messages:
if message.has_attachments:
print(#print attachment name here)

I'm not exactly sure how to access the name attribute or whatever attribute will pull the name. Inspecting the object it looks like there is a name attribute from the BaseAttachments class but if i try something like message.attachments.name it always tells me that attribute doesn't exist.

Tried looking through the source code but I can't figure it out. Any tips?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions