ExtendedData are custom employee extension properties created
through the HR File configuration interface.
It makes it possible to add custom data to your employees. First,
by defining them through extensionUserDefinitions objects, then
by setting their value through extendedData objects.
All example payloads described in this section are sent to the /api/v3/users/{userId}
API endpoint ({userId} being the ID of the user that should be updated).
Extended data values are READ through the optional extendedData field on the User.
But they are WRITTEN through passing their values at the root level of the User object.
A “simple” ExtendedData is an extension property that only has one property itself.
A “single-value” ExtendedData is an extension property that does not accept more than one
value for each employee.
A
Creating a value for a simple single-value ExtendedData
To update an ExtendedData value that does not exist, you must not specify its Id
(or set it to 0).
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_quote":{"value":"99 little bugs in the code..."}}
B
Updating the value of a simple single-value ExtendedData
To update an ExtendedData value that already exists, you must specify the ID of the
ExtendedData value.
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_quote":{"id":4896,"value":"Take one down, patch it around. 127 little bugs in the code..."}}
C
Deleting the value of a simple single-value ExtendedData
To delete the value from an ExtendedData, simply set its value property to null.
The ExtendedData value ID must be specified.
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_quote":{"id":4896,"value":null}}
A “simple” ExtendedData is an extension property that only has one property itself.
A “multiple-value” ExtendedData is an extension property that accepts more than one
value for each employee.
A
Creating a value for a simple multiple-value ExtendedData
To create a multiple-value ExtendedData value, you must send all the occurrences
at the same time and not specify the ID of these occurrences (or set them to 0).
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_favorite_food":[{"id":0,"value":"beer"},{"id":0,"value":"free beer"}]}
B
Appending values to a simple multiple-value ExtendedData
To add occurrences to a multi-valued ExtendedData value that already exists, all
occurrences must be sent at the same time without specifying the IDs of the new
occurrences (or setting them to 0).
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_favorite_food":[{"id":4589,"value":"beer"},{"id":4590,"value":"free beer"},// New occurrences{"id":0,"value":"cold beer"},{"id":0,"value":"more beer"},]}
C
Deleting values from a simple multiple-value ExtendedData
In order to delete some values of an existing multiple-values ExtendedData,
you just have to send only the values you want to keep.
Note: sending an empty array results in the deletion of all existing values
for this ExtendedData (and employee).
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_favorite_food":[{"id":4589,"value":"beer"}// Other existing values will be deleted]}
A “composite” ExtendedData is an extension property that has more than one property itself.
A “single-value” ExtendedData is an extension property that does not accept more than one
value for each employee.
A
Creating a value for a composite single-value ExtendedData
In order to create a value for an existing composite single-value ExtendedData, send a JSON object
whose key is the name of the ExtendedData, and whose value is a JSON object with a value property
which in itself is a JSON object setting the value of each of the ExtendedData properties.
When creating a value, the ExtendedData id may be either omitted or set to zero 0.
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_significant_other":{"id":0,"value":{"e_so_firstname":{"id":0,"value":"Miss"},"e_so_lastname":{"id":0,"value":"Piggy"}}}}
B
Updating the value of a composite single-value ExtendedData
In order to update a composite ExtendedData value, send ALL of its properties values
along their own IDs.
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_significant_other":{"id":2635,"value":{"e_so_firstname":{"id":2636,"value":"Lola"},"e_so_lastname":{"id":2637,"value":"Bunny"}}}}
C
Deleting the value of a composite single-value ExtendedData
In order to delete a composite ExtendedData value, send all the properties of the composite
ExtendedData along their IDs with their values set to null.
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_significant_other":{"id":2635,"value":{"e_so_firstname":{"id":2636,"value":null},"e_so_lastname":{"id":2637,"value":null}}}}
A “composite” ExtendedData is an extension property that has more than one property itself.
A “multiple-value” ExtendedData is an extension property that accepts more than one
value for each employee.
A
Appending a value to a composite multiple-value ExtendedData
In order to create a multiple-value composite ExtendedData, send all the values
at the same time while not givin IDs to the new ones (or set them to 0).
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_objectives":[// First occurrence{"id":0,"value":{"e_e_objective_description":{"id":0,"value":"Write more doc"},"e_objective_year":{"id":0,"value":2017}}}]}
B
Deleting some values of a composite multiple-value ExtendedData
In order to delete some or all values of a multiple-value composite extendedData,
only send the values to keep. To remove all values, send an empty array.
PUT /api/v3/users/416 HTTPS/2Host: example.ilucca.netAuthorization: lucca application={API_KEY}Content-Type: application/json{"e_objectives":[{"id":1726,"value":{"e_e_objective_description":{"id":15855,"value":"Write more doc"},"e_objective_year":{"id":15856,"value":2017}}},{"id":0,"value":{"e_objective_year":{"id":0,"value":2018},"e_e_objective_description":{"id":0,"value":"More doc!"}}}]}
The UserProperties API can be used to retrieve possible entries from a list of values. However, the ExtensionUserDefinitions API /api/v3/extensionuserdefinitions allows to retrieve more information about the possible entries for list type ExtendedData. The objects returned by this API contain an extensionUserPropertyListEntries property, which is an array containing useful information about the entries in the list:
id: numeric value identifying the list entry, which can be inserted into ExtendedData values via the users API;
name: lthe text associated with the list entry, translated into the language of the current user;
translation: the text associated with the list entry, translated into all available languages:
culturedLabels
culture.code: the language of the translation (“en-US”, “fr-FR”, “es-ES”, etc)
value: the translated text in the specified language
// GET xxx.ilucca.net/api/v3/extensionuserdefinitions?fields=id,formatKey,extensionUserPropertyListEntries[id,name,translation[culturedLabels[culture.code,value]]]items:[{"id":"e_eyes_color","formatKey":"select","extensionUserPropertyListEntries":[{"id":84,"name":"Brown","translation":{"culturedLabels":[{"culture":{"code":"en-US"},"value":"Brown"},{"culture":{"code":"fr-FR"},"value":"Marron"},]}},{"id":85,"name":"Blue","translation":{"culturedLabels":[{"culture":{"code":"en-US"},"value":"Blue"},{"culture":{"code":"fr-FR"},"value":"Bleu"},]}},{"id":86,"name":"Green","translation":{"culturedLabels":[{"culture":{"code":"en-US"},"value":"Green"},{"culture":{"code":"fr-FR"},"value":"Vert"},]}}]},{"id":"e_quote",// e_quote is not a list, so extensionUserPropertyListEntries is empty"formatKey":"short","extensionUserPropertyListEntries":[],}, ...]