对于当前登录用户以外的用户,我无法从Microsoft Graph API(v1.0)获取以下用户属性:
aboutMe, hireDate, birthday, mySite, pastProjects
我正在使用this Stack Overflow answer中描述的$select=property1,property2
。
此请求:
https://graph.microsoft.com/v1.0/me/?$select=givenName,aboutMe,hireDate,birthday,mySite,pastProjects
返回以下回复:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(givenName,aboutMe,hireDate,birthday,mySite,pastProjects)/$entity",
"givenName": "Steph",
"aboutMe": null,
"birthday": "0001-01-01T00:00:00Z",
"hireDate": "0001-01-01T00:00:00Z",
"mySite": "https://...",
"pastProjects": []
}
但对于其他任何人,例如:
https://graph.microsoft.com/v1.0/tenantID.onmicrosoft.com/users/someOtherUPN/?$select=givenName,hireDate
我明白了:
{
"error": {
"code": "BadRequest",
"message": "Unable to resolve User Id",
"innerError": {
"request-id": "50988441-cb57-4e32-a0fc-ca141a7afb03",
"date": "2015-11-26T00:37:01"
}
}
}
是否可以为所有用户获取这些字段,而不仅仅是当前登录的用户?
答案 0 :(得分:0)
此问题已得到解决,您在上次选择hireDate时不应再看到该错误消息。