Reference 360 > Reference 360 REST API > enums
  

enums

Use this resource to list system reference data values and add system reference data values.
You can retrieve system reference data values or add values to the following system reference data:

Get system reference data values

Retrieves values of the system reference data.

GET request

To retrieve system reference data values, submit a GET request with the following URI:
/rdm-service/external/v1/enums

GET response

The response contains the values of all the system reference data.
The following table describes attributes in the response:
Field
Type
Description
key
String
ID of the system reference data value.
In Reference 360, when you sort assets in the Explore panel by priority, the assets are sorted based on the key value.
Note: When you import code values, you might want to provide additional information about the data. For example, you might want to assign a code value to the Approved status. You use the key value to assign the appropriate system reference data value.
label
String
Label for the system reference data value. The labels appear in Reference 360.
In Reference 360, the values appear in alphanumeric order based on the label.

GET example

To retrieve the values of all the system reference data, you might use the following request:
GET https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/enums HTTP/1.1
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX
The following sample response shows the values for each system reference data:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 368

{
"Priority":[
{
"key":"0",
"label":"Low"
},
{
"key":"1",
"label":"Medium"
},
{
"key":"2",
"label":"High"
},
{
"key":"9",
"label":"Critical"
}
],
"Domain":[
{
"key":"0",
"label":"Finance"
},
{
"key":"1",
"label":"Geography"
},
{
"key":"2",
"label":"Social"
}
]
}

Add system reference data values

Adds values to the system reference data.

PATCH request

To add values to the system reference data, submit a PATCH request with the following URI:
/rdm-service/external/v1/enums
Use the following attributes in the request body to specify the new values:
Field
Type
Description
key
String
ID of the system reference data value.
In Reference 360, when you sort assets in the Explore panel by priority, the assets are sorted based on the key value.
Note: When you import code values, you might want to provide additional information about the data. For example, you might want to assign a code value to the Approved status. You use the key value to assign the appropriate system reference data value.
label
String
Label for the system reference data value. The labels appear in Reference 360.
In Reference 360, the values appear in alphanumeric order based on the label.
Note: You can use the same value for the key and label parameters.

PATCH response

The response shows the number of values added.
The following table describes the attributes in the response:
Field
Type
Description
newEntries
Number
Number of values added.
existingEntries
Number
Number of existing values that were skipped.

PATCH example

To add values to the system reference data, you might use the following request:
PATCH https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/enums HTTP/1.1
Content-Type: application/json
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX

{
"Priority":[
{
"key":"0",
"label":"Low"
},
{
"key":"1",
"label":"Medium"
},
{
"key":"2",
"label":"High"
},
{
"key":"9",
"label":"Critical"
}
],
"Domain":[
{
"key":"0",
"label":"Finance"
},
{
"key":"1",
"label":"Geography"
},
{
"key":"2",
"label":"Social"
}
]
}
The following sample response shows the number of values added:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 47

{
"newEntries" : 5,
"existingEntries" : 2
}

Update system reference data values

Updates the values of the system reference data.

PATCH request

To update the values of the system reference data, submit a PATCH request with the following URI:
/rdm-service/external/v1/enums
The following table describes the parameter in the request:
Parameter
Description
Overwrite
Optional. Indicates whether to update the existing system reference data values with same keys. Value is true or false. Default is false.
The following table describes the attributes in the request:
Field
Type
Description
key
String
ID of the system reference data value.
In Reference 360, when you sort assets in the Explore panel by priority, the assets are sorted based on the key value.
Note: When you import code values, you can provide additional information about the data. For example, you can assign a code value to the Approved status. You can use the key value to assign the appropriate system reference data value.
label
String
Label for the system reference data value.
In Reference 360, the values appear in alphanumeric order based on the label.

PATCH response

The response shows the number of values updated.
The following table describes the attributes in the response:
Field
Type
Description
newEntries
Number
Number of values added.
existingEntries
Number
Number of existing values that are skipped.
updatedEntries
Number
Number of existing values that are updated.

PATCH example

To update values of the system reference data, you can use the following request:
PATCH https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/enums?overwrite=true HTTP/1.1
Content-Type: application/json
Host: localhost:8080
Content-Length: 368

{
"Priority":[
{
"key":"0",
"label":"Low"
},
{
"key":"1",
"label":"Medium"
},
{
"key":"2",
"label":"High"
},
{
"key":"9",
"label":"Critical"
}
],
"Domain":[
{
"key":"0",
"label":"Finance"
},
{
"key":"1",
"label":"Geography"
},
{
"key":"2",
"label":"Social"
}
]
}
The following sample response shows the number of values updated:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 71

{
"newEntries":1,
"existingEntries":4,
"updatedEntries":2
}

Delete system reference data values

Deletes values of the system reference data.

DELETE request

To delete a value of the system reference data, submit a DELETE request with the following URI:
/rdm-service/external/v1/enum/{enumType}/{enumKey}
Note: You can delete only one system reference data value at a time.
The following table describes the attributes in the request:
Field
Type
Description
enumType
String
Type of system reference data.
enumKey
String
ID of the system reference data value.

DELETE response

A 204 no content response is returned.

DELETE example

To delete a value of the system reference data, you might use the following request:
DELETE https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/enums/status/statusKey HTTP/1.1
Host: localhost:8080
The following sample response shows the no content response:
HTTP/1.1 204 No Content