REST Enumeration API

The Enumeration API provides read-only access to all enumerations in Product 360. The enum entry keys are used in field values as well as for the qualification of fields.

All Enumerations

Returns the list of all available enumerations.

URL Pattern

/enum/info

Method

GET

Parameters

No parameters are available

Media type

text/html, application/json, application/xml

Result

A list of all enumerations defined in the repository

Result

For each enumeration the following properties are returned:

Key

Data type

Description

identifier

String

Unique identifier of the enumeration

dataType

String

Data type of the enumeration entry's key, see also REST Datatypes.

name

String

Localized name of the enumeration

description

String

Localized description of the enumeration

Meta Data and Enumeration Entries

Returns the entries of the specified enumeration.

URL Pattern

/enum/{enumeration-identifier}

Method

GET

Parameters

Parameter

Required

Default

Datatype

Description

container

no

none

ENTITY_ITEM

In case the enum requires a container it must be specified with this parameter and the ENTITY_ITEM syntax.
So either with the internal ID like container=4711 or the identifier like container='MyLookup'
If the parameter is missing but the enumeration needs one, a corresponding status and error message is returned.

Media type

text/html, application/json, application/xml

Result

The meta data of the enumeration (like the localized name) and all entries of the enumeration

Result

The following properties are returned for an enumeration:

Enumeration properties

Field

Data type

Description

identifier

String

Unique identifier of this enumeration

name

String

Localized name of this enumeration

description

String

Localized description of this enumeration

dataType

String

Data type of the enumeration entry's key, see also REST Datatypes.

entries

Array

List of all entries of this enumeration

Each enumeration entry has the following properties:

Properties of a member of entries

Field

Data type

Description

label

String

Unique label of this enumeration entry

key

String or Object

Unique key of this enumeration entry, not necessarily human readable.

In case the key is of type ENTITY_ITEM, the key is represented as proxy object containing the properties id, url and label. If XML is
specified as output format, a proxy object is embedded in the tag object.

When creating a qualified field, this value should be used. If it is a proxy object, the value of the property id should be used.

externalCode

String

External code of the enumeration entry.

keySynonyms

Array of Strings

List synonyms for the entry

Examples

Retrieving all enumerations

Rest Call
curl -u rest:heiler -H "Accept: application/json" -X GET http://localhost:1501/rest/V1.0/enum/info

The following JSON object is returned:

{
"enumerations": [
{
"identifier": "Enum.Language",
"dataType": "INTEGER",
"name": "All languages",
"description": ""
},
...
]}
Rest Client Java Code
EnumerationInfoRequest enumInfoRequest = restClient.createEnumerationInfoRequest();
EnumerationInfos allEnumInfos = enumInfoRequest.getAllEnumerations();
for (EnumerationInfo enumInfo : allEnumInfos)
{
// ...
}

Retrieving the entries of enumeration Enum.Languages

Rest Call
curl -u rest:heiler -H "Accept: application/json" -X GET http://localhost:1501/rest/V1.0/enum/Enum.Language

The following JSON object is returned:

{
"identifier": "Enum.Language",
"name": "All languages",
"description": "",
"dataType": "INTEGER",
"entries": [
{
"label": "Italian",
"key": "16",
"externalCode": "ita",
"synonyms": [
"italian",
"it",
"ita",
"ita_it"
]
},
...
]
}
Rest Client Java Code
EnumerationRequest enumRequest = restClient.createEnumerationRequest();
Enumeration enumeration = enumRequest.getEnumeration( "Enum.Language" );
List< EnumerationEntry > enumEntries = enumeration.getEntries();

Retrieving the entries of enumeration Enum.SupplierWithMainSupplier

Rest Call
curl -u rest:heiler -H "Accept: application/json" -X GET http://localhost:1501/rest/V1.0/enum/Enum.SupplierWithMainSupplier

The following JSON object is returned:

(Note that the keys are in this case returned as proxy objects and the special object <main supplier> does not really exist but is a placeholder for the main supplier as specified within the HPM.)

{
"identifier": "Enum.SupplierWithMainSupplier",
"name": "Suppliers (inc. main supplier)",
"description": "",
"dataType": "ENTITY_ITEM",
"entries": [
{
"label": "<Main supplier>",
"key": {
"id": "-10",
"label": ""
},
"externalCode": "",
"synonyms": []
},
{
"label": "TestProvider",
"key": {
"id": "101",
"label": "TestProvider"
},
"externalCode": "TestProvider",
"synonyms": []
},
{
"label": "Heiler Product Manager",
"key": {
"id": "3",
"label": "Heiler Product Manager"
},
"externalCode": "Heiler Product Manager",
"synonyms": []
}
]
}