Update localized userfield names

Last modified on September 11, 2023 at 2:03 pm

Overview

To update the localized names of a userfield, you can send an HTTP PUT request to the userfield URL with a JSON object containing a localizedNames property with the updated value. The localized names property consists of an object whose properties map ISO-639 locale codes to localized values. When updating this property, all localizations must be provided.

For example, if you have a userfield with German (de) and Spanish (es) localized names, and you want to update only the German translation, you must still provide values for both de and es in the new localizedNames property value. If you specify only de, the value of es will be cleared, leaving you with only a translation for German.

Note that you are not limited to updating one property at a time; all fields that are valid for a particular userfield type may be updated in a single request. All fields not specified will retain their value. See the Userfield Object Reference for a list of all the object’s fields.

Example

This example shows the request-response sequence when updating the localizedNames property on a userfield. This will add translations for the de and es locales and clear any other translations that are currently set for this userfield.

Request
PUT /dc/api/v5/userfields/8da97a97a92efd18dcbc12876a4510e HTTP/1.1
Host: org.digitalchalk.com
Content-type: application/json
Accept: application/json

{
	"localizedNames": {
		"es": "ejemplo entrada",
		"de": "Beispiel Bereich"
	}
}
Response
HTTP/1.1 204 No Content

References