REST API User - LocalName versus Label in Profile Fields

Former Member
Former Member

When creating custom profile fields in the Admin console, you specify a Key and a Label.

...

When you get a user via the REST API, it seems like the Label is the same value as the Key (LocalName).  Is that intentional? (in the screencap below, FirstName and LastName are custom).

  • Former Member
    0 Former Member

    It looks very wrong to me, and doesn't make much sense either.

    In the JSON, LocalName corresponds to the UI's Key with spaces removed, Label is Key and Value is actually Value.  I am not sure why Key is called Label.  LocalName is used for returning REST XML responses.

    When setting up your profile fields, I would recommend making the Key and Label the same value (i.e. First Name).  That is the case for all our OOTB fields.  Then the label returned will match both the label and the key.  That will avoid all confusion and sort of cover up this weirdness.

    I have filed a bug to review this as well.

    TE-15688

  • Former Member
    0 Former Member in reply to Former Member

    Hi , thanks for your response. I did try to set the Key and Label to be the same value when creating the custom field, but the Key property validation rejects spaces. Just FYI.  Thanks!

  • Verint | Telligent Community
    0 Verint | Telligent Community
    TE-15688: RestProfileField data is confusing has been declined as "Won't Do"
  • To clarify, this is being closed because it is working correctly but the old platform-defined fields don't conform to the requirements of REST serialization and are handled as a special case to support backwards compatibility.

    Fields are identified using their key/localname programmatically, but, when serialized for XML, spaces are invalid. As you noted, spaces are not allowed when defining new profile fields, however, the platform-defined fields predate XML serialization and included spaces.

    In the future, when a new version profile fields support/API is defined, this issue will be addressed, however, it is working for now to preserve backwards compatibility and prevent new issues.