I'm trying to retrieve a single user property from a jsom script.
The property is a custom one, not in the default schema.
When I retrieve
http://server/sites/coll/_api/sp.userprofiles.peoplemanager/GetMyProperties/
UserProfileProperties
I get all properties.
When I retrieve
http://server/sites/coll/_api/sp.userprofiles.peoplemanager/GetMyProperties/
UserProfileProperties/MySingleProperty
an error is thrown.
I also tried:
http://server/sites/coll/_api/sp.userprofiles.peoplemanager/GetMyProperties/
UserProfileProperties/?select=MySingleProperty
It does not fail, but all properties are still returned.
What is the correct syntax to retrieve my property?
[Edit] Don't know if it matters, but my property has an hyphen in its name: My-Single-Property
. I tried to escape using unicode like this: My%u002dSingle%002dProperty
, but without success.
You can repro using an OOB field:
_api/sp.userprofiles.peoplemanager/GetMyProperties/?$select=SPS-JobTitle _api/sp.userprofiles.peoplemanager/GetMyProperties/?$select=SPS%2dJobTitle _api/sp.userprofiles.peoplemanager/GetMyProperties/?$select=SPS%u002dJobTitle