I created an app with permissions:
So then I get the permissions from the user and get the final token.
I'm able to get the emails with GET /me/messages/
I'm able to get the folders names and ids with with GET /me/mailFolders/
But 'm not able to move the email to another folder,
I'm doing this:
POST /me/messages/{msg id}/move
Content-type: application/json
{
"destinationId": "junkemail"
}
I tried to send it to other folders, even with folders created manually,I've used the folder name, folder id, but still doesn't work, I always get the same error:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store., The process failed to get the correct properties."
}
}
I am also having Mail.ReadWrite, offline_access, User.Read
permissions. In order to move email, I did the following steps-
POST /me/messages/{id}/move
using above Id and email moved successfully to Junk Email
folder.Please note, Id will get changed once the email is moved to any other folder.
GET /me/messages/{id}
now using the Id generated in first step then you will get below error-So, I would suggest you to make GET /me/messages/{id}
call to check whether the email Id is exist before making POST /me/messages/{id}/move
call.