I had created a Azure active directory v1 in azure for the OAuth connection settings to the bot. I got the user's access token successfully, then I make call to GET https://graph.microsoft.com/v1.0/me with an Authorization: Bearer header.
{
"@odata.context":
"https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"businessPhones": [],
"displayName": "Ram kumar",
"givenName": "kumaran raju",
"jobTitle": null,
"mail": null,
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": "10sa788ad8df-457kdj9dsfs-78d7a8df6a6-7d7a887df7a9",
"userPrincipalName": "something",
"id": "4532523589023895"
}
The above response which I got from that API. But I need to access the user's mail property, which gives only null. So, how I get the logged in user's mail from this response?
答案 0 :(得分:2)
这意味着用户没有mail
属性。 mail
是只读的,它是用户的SMTP地址。它与Exchange Online绑定,除非拥有Exchange Online许可证,否则您无法写入该属性,当为用户激活许可证时,Exchange Online将在创建用户邮箱时使用正确的邮箱邮件地址更新该字段。 。
有关更多详细信息,您可以参考此link。