0
我无法从Microsoft Graph API(v1.0)中为除当前记录以外的用户获取以下用户属性用户:无法使用Microsoft Graph API v1.0获取用户的聘请日期 - “BadRequest无法解析用户标识”
aboutMe, hireDate, birthday, mySite, pastProjects
我使用$select=property1,property2
在this Stack Overflow answer描述。
这个请求:
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": []
}
但对于其他人,E.g:
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"
}
}
}
是否有可能为所有用户获取这些字段,而不仅仅是当前登录的用户?
对于$ select查询,对于不是已登录用户的用户,使用UPN存在问题。我们会调查。 同时请使用用户名代替UPN,例如:graph.microsoft.com/v1.0/users/cde8e228-00b5-4cb6-90c0-e6991b6f82d6?$select=aboutMe,hireDate,birthday,mySite,pastProjects 。 –
@Yina感谢您的快速回复。现在使用用户标识而不是UPN。 –