Unify and manage your data

Manage RDM localizations using APIs

Learn more about lookup localizations using APIs.

Every RDM lookup code has one canonical value and can include translations in multiple languages. Each translation is stored in the localizations array and contains a languageCode, a translated value, and an optional description. Adding localizations does not change the canonical value or the source mappings.

For example, the Country lookup code US has the canonical value USA. On that same code, you can store translations of USA, such as États-Unis for French (fr-FR) and Estados Unidos for Spanish (es-ES).

A lookup must have a canonical value before you can add translations. When you add a translation, use a supported localization code. Only supported codes propagate to MDM.

Use the RDM Lookups API to add translations to the lookup. On the Transcode request, set the Accept-Language header to a language code from the lookup's localizations, such as es-ES, so the response returns the translated value for that language.

Retrieve a lookup

Use a GET request to retrieve the current definition of a lookup code. Use a GET request to retrieve the current definition of a lookup code. Use it to see the canonical value, source mappings, and any translations that already exist before you add or change localizations.

Send a GET request to the endpoint for the lookup type and code. The response includes sourceMappings, which contains the canonical value, and localizations, which contains the translations. If no translations exist, localizations is an empty array.

For more information, see RDM Lookups API.

Request

The following GET request retrieves one lookup code.

GET {{rdm_uri}}/lookups/{{rdm_tenant}}/Country/US
Authorization: Bearer {{token}}

Response

The following response returns the lookup definition, including the canonical value, source mappings, and localizations.

{
  "tenantId": "{{rdm_tenant}}",
  "type": "rdm/lookupTypes/Country",
  "code": "US",
  "enabled": true,
  "sourceMappings": [
    {
      "source": "Reltio",
      "values": [
        {
          "code": "US",
          "value": "USA",
          "enabled": true,
          "canonicalValue": true
        }
      ]
    }
  ],
  "localizations": [],
  "parents": []
}

Add translations to a lookup code

Use the PUT request to add translations to an existing lookup code. In the request body, include a localizations array. For each translation, specify a supported localization code in languageCode, the translated value in value, and an optional description.

Note: A PUT request replaces the entire lookup definition. Include all existing properties in the request body, including sourceMappings, parents, and localizations, or they will be permanently removed. To avoid unintended data loss, retrieve the current definition first, then modify and resubmit the complete object.

Use this method when adding translations for the first time or when you want to update the complete lookup definition. For more information, see RDM Lookups API.

Request

The following PUT request adds translations to the lookup code.

PUT {{rdm_uri}}/lookups/{{rdm_tenant}}/Country/US
Authorization: Bearer {{token}}
Content-Type: application/json

{
  "tenantId": "xyz",
  "type": "rdm/lookupTypes/Countries",
  "code": "Denmark",
  "enabled": true,
  "sourceMappings": [
    {
      "source": "SAP",
      "values": [
        {
          "code": "208",
          "value": "Denmark",
          "enabled": true
        }
      ]
    },
    {
      "source": "Reltio",
      "values": [
        {
          "code": "DK",
          "value": "Denmark",
          "enabled": true
        },
        {
          "code": "DNK",
          "value": "Kingdom of Denmark",
          "enabled": true
        }
      ]
    }
  ],
  "localizations": [
    {
      "languageCode": "es-ES",
      "value": "Dinamarca",
      "description": "Spanish"
    },
    {
      "languageCode": "it-IT",
      "value": "Danimarca",
      "description": "Italian"
    }
  ]
}

Response

The following response returns the lookup definition with the new localizations.

{
    "tenantId": "AbhilashaTurboViewRDM",
    "type": "rdm/lookupTypes/Countries",
    "code": "Denmark",
    "enabled": true,
    "sourceMappings": [
        {
            "source": "SAP",
            "values": [
                {
                    "code": "208",
                    "value": "Denmark",
                    "enabled": true,
                    "canonicalValue": true,
                    "downStreamDefaultValue": true
                }
            ]
        },
        {
            "source": "Reltio",
            "values": [
                {
                    "code": "DK",
                    "value": "Denmark",
                    "enabled": true,
                    "canonicalValue": false,
                    "downStreamDefaultValue": true
                },
                {
                    "code": "DNK",
                    "value": "Kingdom of Denmark",
                    "enabled": true,
                    "canonicalValue": false,
                    "downStreamDefaultValue": false
                }
            ]
        }
    ],
    "localizations": [
        {
            "languageCode": "es-ES",
            "value": "Dinamarca",
            "description": "Spanish"
        },
        {
            "languageCode": "it-IT",
            "value": "Danimarca",
            "description": "Italian"
        }
    ],
    "startDate": 0,
    "endDate": 0,
    "updatedBy": "xyz",
    "updateDate": 1789129559595,
    "version": 4
}

The response returns the updated lookup definition as stored. Verify that the localizations array in the response contains the translations you submitted.

Update individual translations

To change only specific translations, use a partial update instead of full replacement. A partial update sends an INSERT, UPDATE, or DELETE operation for each language code you specify and leaves the source mappings, parents, and attributes unchanged. For more information, see Partial updates for localization and Partial update in RDM lookups.

Return a localized value

Use the POST request to the Transcode API to return a localized lookup value for a downstream system. Set the Accept-Language header to a language available in localizations, such as es-ES.

If you don't specify targetSource, or it doesn't match a source system, the API returns the canonical value in the requested language without the source specified. To return the value for a specific source system, specify the targetSource query parameter.

In the request body, you can specify the source using either a source URI or source name. For example, use rdm/sources/SAP as the source URI or SAP as the source name. Both formats identify the same source system.

Request body with source URI

The following POST request transcodes a lookup value using a source URI.

POST {{rdm_uri}}/transcode/{{rdm_tenant}}/value
Authorization: Bearer {{token}}
Content-Type: application/json
Accept-Language: es-ES

{
    "type": "rdm/lookupTypes/Countries",
    "value": "Côte d'Ivoire",
    "source": "rdm/sources/SAP"
}

Response body with source URI

The following response returns the transcoded lookup and the full source URI.

{
    "type": "rdm/lookupTypes/Countries",
    "code": "Côte d'Ivoire",
    "value": "Côte d'Ivoire",
    "source": "rdm/sources/SAP",
    "attributes": [],
    "success": true
}
Request body with source name

The following POST request transcodes a lookup value using a source name.

POST {{rdm_uri}}/transcode/{{rdm_tenant}}/value
Authorization: Bearer {{token}}
Content-Type: application/json
Accept-Language: es-ES

{
    "type": "rdm/lookupTypes/Countries",
    "value": "Denmark",
    "source": "SAP"
}
Response body with source name

The following response returns the transcoded lookup. Thesourcefield contains the full source URI.

{
    "type": "rdm/lookupTypes/Countries",
    "code": "Denmark",
    "value": "Dinamarca",
    "source": "rdm/sources/SAP",
    "attributes": [],
    "success": true
}
Language priority in the Accept-Language header

You can set the Accept-Language header to more than one language to give RDM a preference list of languages/localizations. RDM checks the languages in the order you list. For example, when the Accept-Language header is set to ko, de-DE, fr-FR, RDM checks for a Korean localization first, followed by German and French, and returns the value for the first available localization.

Note: RDM also supports short-to-long language code fallback. For example, if the request specifies ko and the lookup contains a ko-KR localization, RDM returns the Korean value. For details, see Localization in RDM.

Example request

The following POST request sets more than one language in the Accept-Languageheader.

POST {{rdm_uri}}/transcode/{{rdm_tenant}}/value
Authorization: Bearer {{token}}
Content-Type: application/json
Accept-Language: ko, de-DE, fr-FR

{
    "type": "rdm/lookupTypes/Countries",
    "value": "Japan",
    "source": "SAP"
}

Example response

The following response returns the localized value for the first language in the header that exists in the lookup's localizations.

{
    "type": "rdm/lookupTypes/Countries",
    "code": "Japan",
    "value": "일본",
    "source": "rdm/sources/SAP",
    "attributes": [
        {
            "name": "Population",
            "value": "125000000"
        },
        {
            "name": "Capital",
            "value": "Tokyo"
        },
        {
            "name": "Continent",
            "value": "Asia"
        },
        {
            "name": "Currency",
            "value": "JPY"
        }
    ],
    "success": true
}