A cloud-based identity and access management service for securing user authentication and resource access
"MailboxNotEnabledForRESTAPI" error on personal Microsoft Account when trying to retrieve contacts from it
Hi! I am relatively new for building Azure apps but I have developer background.
I am currently trying to implement getting contacts from my own personal Microsoft account inside a script. For debugging purposes I first try Graph API in Postman.
I have done all steps required for this:
- Created Azure account;
- Created Entra ID app, granted
Contacts.Readpermission, accepted this permission as administrator. I sticked with Application permission, not Delegated; - Read Microsoft Graph API basics;
- Imported Postman collection;
- Got user id of my own account;
- Authenticated, got JWT token;
- Tried to get contacts from my account by the following endpoint:
https://graph.microsoft.com/v1.0/users/<userPrincipalName>/contacts?$filter=startswith(givenName, <some string query>)
The problem
The request above returns error:
{
"error": {
"code": "MailboxNotEnabledForRESTAPI",
"message": "The mailbox is either inactive, soft-deleted, or is hosted on-premise."
}
}
Why does this error happen? It is a personal Microsoft Account. Cloud one, of course. Outlook works for this, no shadow ban, no restrictions.
P. S. Also, Power Automate (cloud) retrieves contacts successfully. As far as I know, it leverages the same API.
P. P. S. Get a closer look to user in Microsoft Entra dashboard:
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
1 answer
Sort by: Oldest
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
1 deleted comment
Comments have been turned off. Learn more