[英]Trying to get Contacts for an Office 365 account using Microsoft Graph API
I am trying to retrieve a list of contacts for an Office 365 account using the Microsoft Graph API. 我正在尝试使用Microsoft Graph API检索Office 365帐户的联系人列表。 When I sign in using a hotmail account, everything works.
当我使用Hotmail帐户登录时,一切正常。 However, if I use an Office 365 account I get the following response error after calling " https://graph.microsoft.com/beta/me/contacts "
但是,如果我使用Office 365帐户,则在调用“ https://graph.microsoft.com/beta/me/contacts ”后会收到以下响应错误
{
"error": {
"code": "ErrorInvalidUser",
"message": "The requested user 'xxxxxx@xxxxxxxx.com' 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. 我尝试在Google上搜索错误,但找不到任何信息可以告诉我Office 365帐户为何不起作用。 Any help would be greatly appreciated.
任何帮助将不胜感激。
It looks your 'xxxxxx@xxxxxxxx.com' is used with both a "Work or school account" and a "Personal account". 看来您的“ xxxxxx@xxxxxxxx.com”已与“工作或学校帐户”和“个人帐户”一起使用。 You need to sign in with your Office 365/"Work or school account" to access its mail or contacts.
您需要使用Office 365 /“工作或学校帐户”登录才能访问其邮件或联系人。 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.
失败的请求是使用为个人帐户发行的令牌发出的,该令牌使用与您的Office 365帐户相同的电子邮件地址作为其标识符。 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.
登录我们的测试应用程序( https://developer.microsoft.com/en-us/graph/graph-explorer )时,系统会询问您要使用哪个帐户。 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).
如果您选择“工作或学校帐户”,那么/ beta / me / contacts请求应该可以工作,但选择“个人帐户”(对于该电子邮件地址)则无效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.