python-o365
python-o365 copied to clipboard
I'm trying to archive mail, getting below error
Code:
msg.move(archival_folder_name)
Error:
Client Error: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/users/email-id/messages/secret-info=/move | Error Message: Id is malformed.
I am not sure how you are passing the folder name but following did the job for me
message.move(mailbox.archive_folder())
message.move(mailbox.archive_folder())
This is the correct way to do it.
You can also:
from O365.utils import OutlookWellKnowFolderNames
# ...
message.move(OutlookWellKnowFolderNames.ARCHIVE.value)