Reputation: 63
I am trying to retrieve a list of contacts for an Office 365 account using the Microsoft Graph API. When I sign in using a hotmail account, everything works. However, if I use an Office 365 account I get the following response error after calling "https://graph.microsoft.com/beta/me/contacts"
{
"error": {
"code": "ErrorInvalidUser",
"message": "The requested user '[email protected]' is invalid.",
"innerError": {
"request-id": "f03da31a-a0d0-4095-9423-8992560c9b26",
"date": "2017-08-09T20:37:16"
}
}
}
I have tried searching for the error on Google but I am unable to find any information that will tell me why Office 365 accounts don't work. Any help would be greatly appreciated.
Upvotes: 1
Views: 552
Reputation: 1704
It looks your '[email protected]' is used with both a "Work or school account" and a "Personal account". You need to sign in with your Office 365/"Work or school account" to access its mail or contacts. The failed request was made with a token issued for a Personal account that uses the same email address as its identifier as your Office 365 account. When signing in to our test app (https://developer.microsoft.com/en-us/graph/graph-explorer) you would be asked which account to want to use. The /beta/me/contacts request should work if you choose "Work or school account", but not when you choose "Personal account" (for that email address).
Upvotes: 2