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:
- 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.
- Microsoft 365 License: Verify that your account has an active Microsoft 365 license. Sometimes, this error occurs if the user lacks the necessary license.
- 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.
- 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.