问题
I am developing an app to retrieve mail/calendar information. I am using the App model v2.0 OAuth2 and the Outlook REST API. I have a personal Live (...@live.nl) account which can use the outlook.com web interface to view mail/calendar data.
When I use the same account with Outlook REST API I get the following error (also in OAuth Outlook Sandbox) while doing this request: https://outlook.office.com/api/v2.0/me/mailfolders/inbox/messages?$top=10
"error": {
"code": "ErrorMissingEmailAddress",
"message": "When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids."
}
What is the cause of this error and how can it be solved ?
回答1:
You are receiving this error because your account hasn't yet been upgraded yet to Office 365 infrastructure and this is required for the REST APIs to work. You can confirm this by logging into outlook.com and see "Outlook.com" in the top left corner. If you have been upgraded, you will see "Outlook Mail (Preview)" instead. We are in the process of deploying a fix to v2.0 endpoint return a more informative error for this case - MailboxNotEnabledForRESTAPI.
We are actively upgrading all accounts to Office 365, so no action needed from your side. In the meantime, to request an Outlook.com developer preview account with the REST APIs enabled, send us an email at outlookdev@microsoft.com.
来源:https://stackoverflow.com/questions/34482838/errormissingemailaddress-error-in-outlook-rest-api