Transcode Hierarchical Lookups
Learn more about how to use the Transcode API to resolve parent lookup values and dependent child lookup values in a single request.
The Transcode for hierarchical lookups resolves parent lookup values and their dependent child lookup values in a single request. The request groups the child values with their parent values, and the response returns the resolved values in the same structure.
RDM resolves each child value against its parent lookup values. When the request contains values from multiple sources, the RDM tenant configuration property transcodeHierarchyOnSource determines which resolved parents RDM uses for validation. For more information, see Lookups and canonical values.
To return the resolved values in a specific language, set the Accept-Language header in the request.
HTTP method and endpoint
Use the following HTTP method and endpoint path to submit the request:
POST https://{{rdm-service}}/transcode/rdm_tenant_name
The following table describes the endpoint path parameter.
| Parameter | Type | Required | Description |
|---|---|---|---|
rdm_tenant_name | String | Yes | Name of the RDM tenant that processes the request. RDM resolves the lookup values against the reference data configured in this tenant. |
Request headers
The following request headers must be included.
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <token> | Yes |
Content-Type | application/json | Yes |
Accept-Language | Language code, such as es-ES | No |
Request body
The request body is a JSON array. Each object in the array pairs a set of parent lookup values with the dependent child lookup values that RDM resolves under those parents.
The following table describes the request body parameters.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
values | Object | Yes | Map of the parent lookup values to resolve. Each key is a parent lookup type URI, and the value mapped to that key is an array of one or more parent lookup values to resolve for that lookup type. | Parent lookup type URI as the key. For example, rdm/lookupTypes/Country. |
type | String | No | Lookup type URI of the individual parent value. The value matches the lookup type URI used as the key in the values map. | Example: rdm/lookupTypes/Country |
value | String | Yes | Parent source value to resolve to its canonical value. | Example: India |
source | String | Yes | Source system that supplied the parent value. | Example: SAP. If omitted, RDM treats value as a canonical value or canonical code. |
| dependentValues | ||||
dependentValues | Array | No | Child lookup values that RDM resolves in the context of the resolved parent values. Include this field only when the request has child values to resolve. Omit it for a parent-only request. | No default |
values | Object | Yes, when dependentValues is included | Map of the child lookup values to resolve. Each key is a child lookup type URI, and the value mapped to that key is an array of one or more child lookup values to resolve for that lookup type. | Child lookup type URI as the key. For example, rdm/lookupTypes/State. |
type | String | No | Lookup type URI of the individual child value. The value matches the lookup type URI used as the key in the child values map. | Example: rdm/lookupTypes/State |
value | String | Yes | Child source value to resolve to its canonical value, evaluated under the resolved parent values. | Example: Kerala |
source | String | No | Source system that supplied the child value. | Example: OKTA. If omitted, RDM treats value as a canonical value or canonical code. |
Example request
The following example shows how a complete request is structured, including the headers and a JSON body.
The example contains two Country values and two dependent City values. Source A provides France and Paris; Source B provides Japan and Paris. In the lookup data for this example, Paris is a valid child of France, but not of Japan. The result depends on whether transcodeHierarchyOnSource is true or false in the RDM tenant configuration.
POST https://{{rdm-service}}/transcode/rdm_tenant_name
[
{
"values": {
"rdm/lookupTypes/Country": [
{
"value": "France",
"source": "SourceA"
},
{
"value": "Japan",
"source": "SourceB"
}
]
},
"dependentValues": [
{
"values": {
"rdm/lookupTypes/City": [
{
"value": "Paris",
"source": "SourceA"
},
{
"value": "Paris",
"source": "SourceB"
}
]
}
}
]
}
]
Response body
The response returns the resolved parent and child values in the same nested structure as the request. The following table describes the fields returned for each resolved value.
| Parameter | Type | Description |
|---|---|---|
values | Object | Map of the resolved parent values, grouped under the parent lookup type URI. |
code | String | Canonical code of the resolved value. RDM returns this field when the value resolves successfully. |
value | String | Canonical value of the resolved value. If the value does not resolve, RDM returns the original input value instead. |
source | String | Source system URI of the value that was submitted. |
success | Boolean | Whether the value resolved successfully. The value is true when resolution succeeds and false when it fails. |
error | String | Message describing why the value did not resolve. RDM returns this field only when resolution fails. |
| dependentValues | ||
dependentValues | Array | Resolved child values, returned in the same nested structure as the request. |
values | Object | Map of the resolved child values, grouped under the child lookup type URI. |
type | String | Lookup type URI of the resolved value. |
Example response
transcodeHierarchyOnSource is false or not set,
RDM checks both Paris values against France and Japan together. Both child values resolve because Paris is a valid child of France.[
{
"values": {
"rdm/lookupTypes/Country": [
{
"code": "FR",
"value": "France",
"source": "rdm/sources/SourceA",
"success": true
},
{
"code": "JP",
"value": "Japan",
"source": "rdm/sources/SourceB",
"success": true
}
]
},
"dependentValues": [
{
"values": {
"rdm/lookupTypes/City": [
{
"code": "PARIS",
"value": "Paris",
"source": "rdm/sources/SourceA",
"success": true
},
{
"code": "PARIS",
"value": "Paris",
"source": "rdm/sources/SourceB",
"success": true
}
]
}
}
]
}
] transcodeHierarchyOnSource is true
RDM checks each Paris value against the country from its source. Paris from Source A resolves under France. Paris from Source B fails validation under Japan.[
{
"values": {
"rdm/lookupTypes/Country": [
{
"code": "FR",
"value": "France",
"source": "rdm/sources/SourceA",
"success": true
},
{
"code": "JP",
"value": "Japan",
"source": "rdm/sources/SourceB",
"success": true
}
]
},
"dependentValues": [
{
"values": {
"rdm/lookupTypes/City": [
{
"type": "rdm/lookupTypes/City",
"code": "PARIS",
"value": "Paris",
"source": "rdm/sources/SourceA",
"success": true
},
{
"type": "rdm/lookupTypes/City",
"value": "Paris",
"source": "rdm/sources/SourceB",
"error": "1003: RDM canonical value mapping not found for value [Paris] and source [SourceB] in tenant [rdm_tenant_name]",
"success": false
}
]
}
}
]
}
]Error codes and recommended actions
The following table lists the possible error responses returned by this API.
| Error code | Description | Recommended action |
|---|---|---|
1001 | The source in the request is not configured in the RDM tenant. | Confirm the source exists in the RDM tenant and that source matches a configured source URI or source name, then resend the request. |
1002 | The lookup type in the request is not configured in the RDM tenant. | Confirm the lookup type exists in the RDM tenant and that type matches the configured lookup type URI, then resend the request. |
1003 | The lookup value has no matching canonical mapping, or a dependent value does not match the applicable resolved parent values. |
Confirm that the value has a canonical mapping for its source. If the value is a child, confirm that its configured parent matches a parent value that resolved in the request. When transcodeHierarchyOnSource is true, check whether the parent value from the child's source resolved, then resend the request. |