Haiilo API: Pronouns as a profile field

In Haiilo, you can add a profile field to display the set pronouns of a user. The pronouns are added as a suffix to the display name on the profile page, in the colleague overview, and the global search:

00b157b6-2c7c-4891-a858-cb854d412210.png

How to configure the profile field

If you have set up your Haiilo Home after version 45.0.90, you already have the field directly below the birthday field for a user.

However, if you set up your Haiilo Home before version 45.0.90, you need to add the profile field named "haiilo_pronouns" to a profile group via REST API so a user can use the profile field. Once the field exists and contains a value, it is displayed to users. For the full technical documentation of Haiilo's REST API, please see here.

How to add the field via REST API

First, identify the ID of the profile field group to which you want to add the pronoun profile field. You can add profile fields only if you update the entire profile group. You can use this request to retrieve all groups:

GET {{URL}}/api/users/profile/groups

And this request to retrieve a single group by its ID:

GET {{URL}}/api/users/profile/groups/{ID_OF_YOUR_GROUP}}

Save the response to this request as it contains the name, sort order, and fields of all profile fields in the group for the next step.

Note:

Since a PUT request not only adds to the existing group, but overwrites it completely, it sends not only the new field "pronouns" but also all the existing fields.

Now use the entire response as the request body for the upcoming PUT request and add this field to the fields-array for the haiilo_pronouns. Capital letters for "type" is important here.

{
"name": "haiilo_pronouns",
"type": "TEXT",
"order": 0
},

Note:

You can additionally adjust the order of this and the other fields to influence the position on the profile page.

Here is an example of the full request (please don't just copy this from the article as the values might change):

PUT {{URL}}/api/users/profile/groups/{{YOUR_GROUP_ID}}
{
"name":"basicInformation",
"sortOrder":1,
"fields":[
{
"name":"birthday",
"type":"BIRTHDAY",
"order":0,
"overview":false,
"important":false,
"userChooser":false,
"searchAggregation":false
},
{
"name":"haiilo_pronouns",
"type":"TEXT",
"order":0
},
{
"name":"languages",
"type":"TEXT",
"order":1,
"overview":false,
"important":false,
"userChooser":false,
"searchAggregation":false
},
{
"name":"homeTown",
"type":"TEXT",
"order":2,
"overview":false,
"important":false,
"userChooser":false,
"searchAggregation":false
},
{
"name":"interests",
"type":"TEXT",
"order":3,
"overview":false,
"important":false,
"userChooser":false,
"searchAggregation":false
},
{
"name":"projects",
"type":"TEXT",
"order":3,
"overview":false,
"important":false,
"userChooser":false,
"searchAggregation":false
},
{
"name":"expertise",
"type":"TEXT",
"order":3,
"overview":false,
"important":false,
"userChooser":false,
"searchAggregation":false
},
{
"name":"about",
"type":"TEXTAREA",
"order":3,
"overview":false,
"important":false,
"userChooser":false,
"searchAggregation":false
}
]
}

To check if it worked, just go to a user's profile page and edit the corresponding profile group. Here you should find a pronoun field.

f62704f1-ffbb-4822-b283-b70ecf206286.png

If you want to customize the translation of the profile field, you can do it the usual way.

Was this article helpful?