An API that connects multiple Microsoft services, enabling data access and automation across platforms
Can't delete attachment on a forward draft using Graph API using shared mailbox
I'm trying to create a forward of an email received through a shared account, but removing any attachment the original email had.
I can create the forward draft with the API call:
POST /1.0/users/{email}/messages/{message_id}/createForward
After that, I get the list of attachments for the draft with a call to GET:
GET /1.0/users/{email}/messages/{draft_message_id}/attachments
Both calls work correctly, returning the expected data. I even can see the created forward in the Draft folder of the shared mailbox.
But when I try to delete the attachments, it fails. The API call is:
DELETE /1.0/users/{email}/messages/{draft_message_id}/attachments/{attachment_id}
The attachment_id is taken from the GET message.
The response is 503 - Service Unavailable, with this content (i've edited the mailbox id):
{
"error": {
"code": "ErrorMailboxMoveInProgress",
"message": "Mailbox move in progress. Try again later., Cross Server access is not allowed for mailbox d15xxxxx-xxxx-xxxx-xxxx-xxxxx4dce97c" }
}
If I manually add an attachment and try to remove it, it works. This only happens for attachments that were present in the original email. Issuing a send API call works fine, sending the email, but with the attachments.