Share via

Request API access to personal outlook.com

Alexis Kt 20 Reputation points
2024-10-11T13:27:32.8766667+00:00

Hello,

Following the deactivation of basic authentication, I can no longer access my mailbox via API.
I have corrected the code to use Oauth2 through Microsoft Entra, but I get the following error message:
{'error': {'code': 'MailboxNotEnabledForRESTAPI', 'message': 'The mailbox is either inactive, soft-deleted, or is hosted on-premise.'}}

Could you activate the API for personal mailbox?

I looked at this page which asks you to send an e-mail to outlookdev@microsoft.com, but the mailbox no longer exists.
https://learn.microsoft.com/fr-fr/previous-versions/office/office-365-api/api/version-1.0/use-outlook-rest-api-v1

Regards,

Outlook | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph

Answer accepted by question author

Anonymous
2024-10-14T06:30:45.5266667+00:00

Hello Alexis Kt,

Thank you for reaching out to Microsoft Support!

This error may be due to the flow you used to obtain the token, please use Auth code flow to obtain the token, the specific process is as follows:

https://learn.microsoft.com/en-us/graph/auth-v2-user?tabs=http

Hope this helps.

If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Hitesh Pachipulusu - MSFT 3,640 Reputation points Microsoft External Staff
    2024-10-14T06:11:21.41+00:00

    Hello Alexis Kt,

    Thank you for reaching out to Microsoft Support!

    It sounds like you're encountering a common issue when transitioning to OAuth2 for accessing your mailbox. The error message MailboxNotEnabledForRESTAPI typically indicates that the mailbox is either inactive, soft-deleted, or hosted on-premise.

    Here are a few steps you can take to resolve this issue:

    1. Check Mailbox Status: Ensure that your mailbox is active and not soft-deleted. You can do this by logging into your Outlook account via the web interface.
    2. Microsoft 365 License: Verify that your account has an active Microsoft 365 license. Sometimes, this error occurs if the user lacks the necessary license.
    3. Permissions and Consent: Make sure you have granted the correct permissions and consent for the API access. You might need to clear your browser cache and re-authenticate to ensure the permissions are correctly applied.
    4. Use Microsoft Graph API: The Outlook REST API v1.0 is deprecated. It's recommended to use the Microsoft Graph API instead, which provides a more robust and future-proof way to access mailbox data.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.