0

I try to query a user including extended properties:

/users/xxx@xx.dk?$expand=properties

However I get following error:

Could not find a property named 'properties' on type 'microsoft.graph.user.

Is it possible in one request to get a user object with all of it's extended properties?

Best scenario would be something like following where I query for the departmentNumber from the extended properties with direct properties:

/users/xx@xx.dk?$select=companyName,officeLocation,departmentNumber&$expand=properties
Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
Thomas Segato
  • 4,567
  • 11
  • 55
  • 104
  • Extended properties are not a feature of [User](https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0). It is a feature of Mail, Event, and Contacts (I believe). I think you want to use a feature called [Schema Extensions](https://learn.microsoft.com/en-us/graph/api/resources/schemaextension?view=graph-rest-1.0). How is the departmentNumber being added to the User object? – Michael Mainer Jan 18 '19 at 18:31

1 Answers1

1

This is because, as the message states, there is no property named properties.

How you retrieve custom properties depends on how they were created. There are two types: Open Extensions and Schema Extensions. Each is stored and behaves a little differently so you'll want to refer to the documentation I linked to for help determining which type you want to use.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • Got it working now: https://graph.microsoft.com/v1.0/users/xx@xx.dk?$select=companyName,officeLocation,departmentNumber,extension_xx_employeeNumber. The property just wasent synced. Thanks all! – Thomas Segato Jan 23 '19 at 20:47