Table of Contents

Search

  1. Preface
  2. Introducing Reference 360
  3. Getting started with Reference 360
  4. Manage system reference data
  5. Manage reference data sets
  6. Manage code lists
  7. Manage code values
  8. Manage crosswalks
  9. Import data
  10. Manage hierarchies
  11. Manage attributes
  12. Manage workflows
  13. Manage jobs
  14. Reference 360 REST API
  15. Glossary

Reference 360

Reference 360

Update a code value

Update a code value

Updates a code value in a code list.

PATCH request

To update a code value in a code list, submit a PATCH request with the following URI:
/rdm-service/external/v1/codelists/{listIdentifier}/codevalues
The following table describes the parameter in the request:
Parameter
Type
Description
listIdentifier
String
ID of the code list that the code values belong to.
The following table describes the attributes in the request:
Field
Type
Description
action
String
Action to perform on code values. Value is
UPDATE
.
records
Array
List of code values to update.
Name
String
Name of the field.
Code
String
The code field of the code value to create.
Description
String
Description of the code value.
status
String
Optional. Status of the code value.
When you specify attributes in the request body, consider the following guidelines:
  • The attribute names are case-sensitive.
  • Use camel case for name and code attributes and lowercase for other fields, such as dependency.
  • Use string data type for a decimal attribute.
  • Ensure that you include values for all the fields of an existing code value. If you specify only the field values that you want to update, the REST API updates the specified field values and sets the other field values to null.
You can't update code values that are defined as a parent code value in a hierarchical code list. Use the code value REST API to move a code value to another node within the same hierarchical code list.
To update a code value, ensure that you use the Code attribute value. If you don't use the Code attribute value, the following error appears:
The specified code value does not exist
When you update a code value in a hierarchical code list, you don't need to use the parentCode attribute.

PATCH response

The response generates a report of code values that were updated.
The following table describes the attributes in the response:
Field
Type
Description
successfulRecords
-
Lists the code values that were updated successfully and describes the details of the code values.
Code
String
Code attribute value for the updated code value.
label
String
Display attribute value for the updated code value.
failedRecords
-
Lists the code values that weren't updated and describes the reasons.
label
String
Display attribute value for the code value that wasn't updated.
Code
String
Code attribute value for the code value that wasn't updated.
errorCauses
-
Error details for the code values that couldn't be updated.
errorCode
String
Error code for the error type.
errorSummary
String
A short summary that explains why the code value wasn't updated.
localizedErrorSummary
String
A short summary that explains the error in the user locale.
errorParameter
String
Parameter that provides details of an error.
successfulRecordsCount
String
Number of code values that were updated successfully.
failedRecordsCount
String
Number of code values that weren't updated.

PATCH example

To update a code value in a code list, you might use the following request:
PATCH https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/codelists/b32a4e91e42dee8fb6d7e92d/codevalues HTTP/1.1 Content-Type: application/json Accept: application/json IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX { "action": "UPDATE", "records": [ { "Name": "NAME-A", "Code": "CODE-A", "Description": "DESCRIPTION-A", "status": "ActiveKey" } ] } }
The following sample response shows the error report for a failed code value update:
HTTP/1.1 201 Updated Location: /subset/71253be5deb0e7d4974935e0/cursor Content-Type: application/json Content-Length: 39 { "successfulRecords": [], "failedRecords": [ { "label": "NAME-A", "errorCauses": [ { "errorCode": "RDM.001027674", "errorSummary": "The specified code value does not exist.", "errorParameter": { "Code": "CODE-A" } } ], "Code": "CODE-A" } ], "successfulRecordsCount": 0, "failedRecordsCount": 1 }

0 COMMENTS

We’d like to hear from you!