Enterprise Data Catalog REST API Reference > Use Cases > Create Reference Attribute
  

Create Reference Attribute

The sample use case is to create a reference attribute with the with the following properties:
You can use the REST API and create the custom reference attribute in one of the following ways:
Using Java code and the Bundled Java Client
public void createContactReferenceAttribute() throws ApiException {
this.api.catalogModelsReferenceAttributesPost(new RefAttributesPost()
.addItemsItem(new RefAttributePost()
.name("Contact")
.refDataTypeId("com.infa.ldm.isp.UserDatatype")
.description("Person to contact for more information.")
.searchable(false)
.addClassesItem(new ModelRefRequest().id("core.IClass"))));
}

}
Using Curl
curl -X POST --header "Accept: application/json" --header "Content-Type: application/json" -d "{
\"items\": [
{
\"refDataTypeId\": \"com.infa.ldm.isp.UserDatatype\",
\"name\": \"Contact\",
\"description\": \"Person to contact for more information.\",
\"searchable\": false,
\"classes\": [
{
\"id\": \"core.IClass\"
}
]
}
]
}" "http://localhost:13000/2/catalog/models/referenceAttributes"