SchemaExtensions is different from extensionProperty. What you mentioned should be extensionProperty in Microsoft Graph.
You can use List extensionProperties to get all extensions.
Your request v1.0/users/[user id]?$expand=extensions&$select=id,extension_[application id]_myExtension,onPremisesExtensionAttributes,displayName,jobTitle,identities
should be correct.
Please make sure that the application id
should remove all -
. The extension property format is extension_[application id without "-"]_myExtension
.
For example:
GET https://graph.microsoft.com/v1.0/me?$select=id,extension_6d****fbf1fe4bc38a5a145520****89_policy,displayName
Response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,extension_6d****fbf1fe4bc38a5a145520****89_policy,displayName)/$entity",
"id": "98****c9-f062-48e2-8ced-22cb68****ce",
"displayName": "Allen Wu",
"extension_6d****fbf1fe4bc38a5a145520****89_policy": "readwrite"
}
The C# code sample:
var user = await graphClient.Users["98****c9-f062-48e2-8ced-22cb6****ce"]
.Request()
.Select("id,extension_6d****fbf1fe4bc38a5a145520****89_policy,displayName")
.GetAsync();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…