python-o365 icon indicating copy to clipboard operation
python-o365 copied to clipboard

I'm trying to archive mail, getting below error

Open mohit12r opened this issue 4 years ago • 2 comments

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.

mohit12r avatar Apr 30 '21 12:04 mohit12r

I am not sure how you are passing the folder name but following did the job for me

message.move(mailbox.archive_folder())

adnanrafique avatar Oct 22 '22 20:10 adnanrafique

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)

alejcas avatar Oct 27 '22 08:10 alejcas