从Microsoft Graph API添加备用邮件ID

时间:2017-09-29 09:06:03

标签: microsoft-graph azure-ad-graph-api

我正在尝试使用来自.Net Core应用程序的Microsoft Graph API添加备用电子邮件。

Microsoft Graph中的user类不提供用于添加其他邮件ID的属性。

2 个答案:

答案 0 :(得分:4)

您可以使用Azure AD Graph将邮件ID添加到otherMails。以下是更新此属性的示例:

PATCH: https://graph.windows.net/{tenant}/me?api-version=1.6
authorization: bearer {access_token}

{
"otherMails":["test@test.com"]
}

请参阅以下链接以获取用户实体并更新用户REST:

Entity and complex type reference | Graph API reference

Update User

答案 1 :(得分:0)

这是检索备用电子邮件的C#代码

Select(u => new {
    u.DisplayName,
    u.Mail,
    u.UserPrincipalName,
    u.OtherMails
})
.GetAsync();  
相关问题